]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
net: remove useless memset's in drivers get_stats64
authorstephen hemminger <stephen@networkplumber.org>
Sat, 7 Jan 2017 03:12:53 +0000 (19:12 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 8 Jan 2017 22:51:44 +0000 (17:51 -0500)
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>
drivers/net/ethernet/apm/xgene/xgene_enet_main.c
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/intel/e1000e/netdev.c

index 45f2204e6695d973ae10c9b08a16c9c6aa4fb79c..de59db6c58419667bb84d487aab61649205592de 100644 (file)
@@ -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) {
index e5f458396e1aed518abb3e191eb07f425b86ee0d..7bd2a85694dd6f11c1d0fa7a3886b87b09577f3d 100644 (file)
@@ -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;
 
index 723025b317cc97e24373f8b6daecc87ca27229da..79651eb608ffddd7db141b94f55f303bbec7b1e7 100644 (file)
@@ -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 */