]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: mv643xx: use ethtool_puts
authorRosen Penev <rosenp@gmail.com>
Fri, 18 Oct 2024 20:05:22 +0000 (13:05 -0700)
committerAndrew Lunn <andrew@lunn.ch>
Tue, 22 Oct 2024 22:44:51 +0000 (17:44 -0500)
Allows simplifying get_strings and avoids manual pointer manipulation.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Message-ID: <20241018200522.12506-1-rosenp@gmail.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
drivers/net/ethernet/marvell/mv643xx_eth.c

index 4abd3ebcdbd6a717b69755946179bf25442c89a5..a06048719e84437856cf2f97970bfa35523269bb 100644 (file)
@@ -1698,13 +1698,9 @@ static void mv643xx_eth_get_strings(struct net_device *dev,
 {
        int i;
 
-       if (stringset == ETH_SS_STATS) {
-               for (i = 0; i < ARRAY_SIZE(mv643xx_eth_stats); i++) {
-                       memcpy(data + i * ETH_GSTRING_LEN,
-                               mv643xx_eth_stats[i].stat_string,
-                               ETH_GSTRING_LEN);
-               }
-       }
+       if (stringset == ETH_SS_STATS)
+               for (i = 0; i < ARRAY_SIZE(mv643xx_eth_stats); i++)
+                       ethtool_puts(&data, mv643xx_eth_stats[i].stat_string);
 }
 
 static void mv643xx_eth_get_ethtool_stats(struct net_device *dev,