Commit 5944701d authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

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: default avatarStephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bc1f4470
...@@ -1462,7 +1462,6 @@ static void xgene_enet_get_stats64( ...@@ -1462,7 +1462,6 @@ static void xgene_enet_get_stats64(
struct xgene_enet_desc_ring *ring; struct xgene_enet_desc_ring *ring;
int i; int i;
memset(stats, 0, sizeof(struct rtnl_link_stats64));
for (i = 0; i < pdata->txq_cnt; i++) { for (i = 0; i < pdata->txq_cnt; i++) {
ring = pdata->tx_ring[i]; ring = pdata->tx_ring[i];
if (ring) { if (ring) {
......
...@@ -5885,8 +5885,6 @@ bnxt_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) ...@@ -5885,8 +5885,6 @@ bnxt_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
u32 i; u32 i;
struct bnxt *bp = netdev_priv(dev); struct bnxt *bp = netdev_priv(dev);
memset(stats, 0, sizeof(struct rtnl_link_stats64));
if (!bp->bnapi) if (!bp->bnapi)
return; return;
......
...@@ -5925,7 +5925,6 @@ void e1000e_get_stats64(struct net_device *netdev, ...@@ -5925,7 +5925,6 @@ void e1000e_get_stats64(struct net_device *netdev,
{ {
struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_adapter *adapter = netdev_priv(netdev);
memset(stats, 0, sizeof(struct rtnl_link_stats64));
spin_lock(&adapter->stats64_lock); spin_lock(&adapter->stats64_lock);
e1000e_update_stats(adapter); e1000e_update_stats(adapter);
/* Fill out the OS statistics structure */ /* Fill out the OS statistics structure */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment