Skip to content

Commit

Permalink
net: remove useless memset's in drivers get_stats64
Browse files Browse the repository at this point in the history
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 <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
stephen hemminger authored and David S. Miller committed Jan 8, 2017
1 parent bc1f447 commit 5944701
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion drivers/net/ethernet/apm/xgene/xgene_enet_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,6 @@ static void xgene_enet_get_stats64(
struct xgene_enet_desc_ring *ring;
int i;

memset(stats, 0, sizeof(struct rtnl_link_stats64));
for (i = 0; i < pdata->txq_cnt; i++) {
ring = pdata->tx_ring[i];
if (ring) {
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -5885,8 +5885,6 @@ bnxt_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
u32 i;
struct bnxt *bp = netdev_priv(dev);

memset(stats, 0, sizeof(struct rtnl_link_stats64));

if (!bp->bnapi)
return;

Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/intel/e1000e/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -5925,7 +5925,6 @@ void e1000e_get_stats64(struct net_device *netdev,
{
struct e1000_adapter *adapter = netdev_priv(netdev);

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

0 comments on commit 5944701

Please sign in to comment.