Skip to contentSkip to conversation

net: mediatek: use ethtool_puts

PATCH In review Rosen Penev 2 participants 2 messages Aug 7, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: mediatek: use ethtool_puts

Allows simplifying get_strings and avoids manual pointer manipulation.

---
 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/mediatek/mtk_eth_soc.c +2 -4
index 16ca427cf4c3..0cd050f83126 100644
@@ -4329,10 +4329,8 @@ static void mtk_get_strings(struct net_device *dev, u32 stringset, u8 *data)
 	case ETH_SS_STATS: {
 		struct mtk_mac *mac = netdev_priv(dev);
 
-		for (i = 0; i < ARRAY_SIZE(mtk_ethtool_stats); i++) {
-			memcpy(data, mtk_ethtool_stats[i].str, ETH_GSTRING_LEN);
-			data += ETH_GSTRING_LEN;
-		}
+		for (i = 0; i < ARRAY_SIZE(mtk_ethtool_stats); i++)
+			ethtool_puts(&data, mtk_ethtool_stats[i].str);
 		if (mtk_page_pool_enabled(mac->hw))
 			page_pool_ethtool_stats_get_strings(data);
 		break;
Signature · 1 line
2.45.2
#1 lore raw
Quoted 1 line · Rosen Penev

Allows simplifying get_strings and avoids manual pointer manipulation.

Please run ./scripts/get_maintainers.pl on this patch, to get a list of people you should Cc:

https://docs.kernel.org/process/submitting-patches.html

The change itself looks O.K, but we should try to solve the processes problems.

Andrew

---
pw-bot: cr