Skip to content

Commit 5944701

Browse files
shemmingerdavem330
authored andcommitted
net: remove useless memset's in drivers get_stats64
In dev_get_stats() the statistic structure storage has already been zeroed. Therefore network drivers do not need to call memset() again. Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bc1f447 commit 5944701

File tree

3 files changed

+0
-4
lines changed

3 files changed

+0
-4
lines changed

drivers/net/ethernet/apm/xgene/xgene_enet_main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,6 @@ static void xgene_enet_get_stats64(
14621462
struct xgene_enet_desc_ring *ring;
14631463
int i;
14641464

1465-
memset(stats, 0, sizeof(struct rtnl_link_stats64));
14661465
for (i = 0; i < pdata->txq_cnt; i++) {
14671466
ring = pdata->tx_ring[i];
14681467
if (ring) {

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5885,8 +5885,6 @@ bnxt_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
58855885
u32 i;
58865886
struct bnxt *bp = netdev_priv(dev);
58875887

5888-
memset(stats, 0, sizeof(struct rtnl_link_stats64));
5889-
58905888
if (!bp->bnapi)
58915889
return;
58925890

drivers/net/ethernet/intel/e1000e/netdev.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5925,7 +5925,6 @@ void e1000e_get_stats64(struct net_device *netdev,
59255925
{
59265926
struct e1000_adapter *adapter = netdev_priv(netdev);
59275927

5928-
memset(stats, 0, sizeof(struct rtnl_link_stats64));
59295928
spin_lock(&adapter->stats64_lock);
59305929
e1000e_update_stats(adapter);
59315930
/* Fill out the OS statistics structure */

0 commit comments

Comments
 (0)