Thread (13 messages) 13 messages, 8 authors, 2023-12-08

RE: [PATCH net-next v5 3/3] net: Convert some ethtool_sprintf() to ethtool_puts()

flat view

From: Wei Fang <wei.fang@nxp.com>
Date: 2023-12-07 07:20:04
Also in: bpf, intel-wired-lan, linux-mediatek, lkml, netdev

quoted hunk ↗ jump to hunk
-----Original Message-----
From: justinstitt@google.com <justinstitt@google.com>
Sent: 2023年12月7日 7:16
To: David S. Miller <davem@davemloft.net>; Eric Dumazet
[off-list ref]; Jakub Kicinski [off-list ref]; Paolo Abeni
[off-list ref]; Shay Agroskin [off-list ref]; Arthur
Kiyanovski [off-list ref]; David Arinzon
[off-list ref]; Noam Dagan [off-list ref]; Saeed
Bishara [off-list ref]; Rasesh Mody [off-list ref];
Sudarsana Kalluru [off-list ref]; GR-Linux-NIC-Dev@marvell.com;
Dimitris Michailidis [off-list ref]; Yisen Zhuang
[off-list ref]; Salil Mehta [off-list ref]; Jesse
Brandeburg [off-list ref]; Tony Nguyen
[off-list ref]; Louis Peens [off-list ref];
Shannon Nelson [off-list ref]; Brett Creeley
[off-list ref]; drivers@pensando.io; K. Y. Srinivasan
[off-list ref]; Haiyang Zhang [off-list ref]; Wei Liu
[off-list ref]; Dexuan Cui [off-list ref]; Ronak Doshi
[off-list ref]; VMware PV-Drivers Reviewers
[off-list ref]; Andy Whitcroft [off-list ref]; Joe
Perches [off-list ref]; Dwaipayan Ray [off-list ref];
Lukas Bulwahn [off-list ref]; Hauke Mehrtens
[off-list ref]; Andrew Lunn [off-list ref]; Florian Fainelli
[off-list ref]; Vladimir Oltean [off-list ref]; Arınç ÜNAL
[off-list ref]; Daniel Golle [off-list ref]; Landen
Chao [off-list ref]; DENG Qingfang [off-list ref];
Sean Wang [off-list ref]; Matthias Brugger
[off-list ref]; AngeloGioacchino Del Regno
[off-list ref]; Linus Walleij
[off-list ref]; Alvin Šipraga [off-list ref]; Wei Fang
[off-list ref]; Shenwei Wang [off-list ref]; Clark
Wang [off-list ref]; dl-linux-imx [off-list ref]; Lars
Povlsen [off-list ref]; Steen Hegelund
[off-list ref]; Daniel Machon
[off-list ref]; UNGLinuxDriver@microchip.com; Jiawen
Wu [off-list ref]; Mengyuan Lou
[off-list ref]; Heiner Kallweit [off-list ref];
Russell King [off-list ref]; Alexei Starovoitov [off-list ref];
Daniel Borkmann [off-list ref]; Jesper Dangaard Brouer
[off-list ref]; John Fastabend [off-list ref]
Cc: <redacted>; <redacted>; Nick Desaulniers
[off-list ref]; Nathan Chancellor [off-list ref]; Kees
Cook [off-list ref]; intel-wired-lan@lists.osuosl.org;
oss-drivers@corigine.com; linux-hyperv@vger.kernel.org;
linux-arm-kernel@lists.infradead.org; linux-mediatek@lists.infradead.org;
bpf@vger.kernel.org; Justin Stitt [off-list ref]
Subject: [PATCH net-next v5 3/3] net: Convert some ethtool_sprintf() to
ethtool_puts()

This patch converts some basic cases of ethtool_sprintf() to ethtool_puts().

The conversions are used in cases where ethtool_sprintf() was being used
with just two arguments:
|       ethtool_sprintf(&data, buffer[i].name);
or when it's used with format string: "%s"
|       ethtool_sprintf(&data, "%s", buffer[i].name);
which both now become:
|       ethtool_puts(&data, buffer[i].name);

Signed-off-by: Justin Stitt <justinstitt@google.com>
---
 drivers/net/ethernet/freescale/fec_main.c          |  4 +-
diff --git a/drivers/net/ethernet/freescale/fec_main.c
b/drivers/net/ethernet/freescale/fec_main.c
index c3b7694a7485..bae9536de767 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2932,10 +2932,10 @@ static void fec_enet_get_strings(struct
net_device *netdev,
 	switch (stringset) {
 	case ETH_SS_STATS:
 		for (i = 0; i < ARRAY_SIZE(fec_stats); i++) {
-			ethtool_sprintf(&data, "%s", fec_stats[i].name);
+			ethtool_puts(&data, fec_stats[i].name);
 		}
 		for (i = 0; i < ARRAY_SIZE(fec_xdp_stat_strs); i++) {
-			ethtool_sprintf(&data, "%s", fec_xdp_stat_strs[i]);
+			ethtool_puts(&data, fec_xdp_stat_strs[i]);
 		}
 		page_pool_ethtool_stats_get_strings(data);
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help