net: ethernet: mediatek: enhance with avoiding superfluous assignment inside mtk_get_...
authorSean Wang <sean.wang@mediatek.com>
Tue, 20 Sep 2016 03:26:48 +0000 (11:26 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Sep 2016 04:06:32 +0000 (00:06 -0400)
data_src is unchanged inside the loop, so this patch moves
the assignment to outside the loop to avoid unnecessarily
assignment

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mediatek/mtk_eth_soc.c

index 481f3609a1ea23a5bc727a173528696d2ea59ac2..ca6b5013e27541bf01a66fdb7a63912e492fde5a 100644 (file)
@@ -2137,8 +2137,9 @@ static void mtk_get_ethtool_stats(struct net_device *dev,
                }
        }
 
+       data_src = (u64 *)hwstats;
+
        do {
-               data_src = (u64 *)hwstats;
                data_dst = data;
                start = u64_stats_fetch_begin_irq(&hwstats->syncp);