From: Sean Wang <[email protected]>

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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
---
 .../ramips/files-4.14/drivers/net/ethernet/mediatek/ethtool.c  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/ethtool.c 
b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/ethtool.c
index 5732c28536..edadf4fc30 100644
--- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/ethtool.c
+++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/ethtool.c
@@ -192,8 +192,9 @@ static void fe_get_ethtool_stats(struct net_device *dev,
                }
        }
 
+       data_src = &hwstats->tx_bytes;
+
        do {
-               data_src = &hwstats->tx_bytes;
                data_dst = data;
                start = u64_stats_fetch_begin_irq(&hwstats->syncp);
 
-- 
2.17.1


_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to