From: Kurt Kanzenbach <kurt@linutronix.de>
To: Rosen Penev <rosenp@gmail.com>, netdev@vger.kernel.org
Cc: "Florian Fainelli" <florian.fainelli@broadcom.com>,
"Andrew Lunn" <andrew@lunn.ch>,
"Vladimir Oltean" <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Woojung Huh" <woojung.huh@microchip.com>,
"maintainer:MICROCHIP KSZ SERIES ETHERNET SWITCH DRIVER"
<UNGLinuxDriver@microchip.com>,
"Clément Léger" <clement.leger@bootlin.com>,
"George McCollister" <george.mccollister@gmail.com>,
"Simon Horman" <horms@kernel.org>,
"open list" <linux-kernel@vger.kernel.org>,
"open list:RENESAS RZ/N1 A5PSW SWITCH DRIVER"
<linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH net-next] net: dsa: use ethtool string helpers
Date: Tue, 22 Oct 2024 10:29:16 +0200 [thread overview]
Message-ID: <87bjzcmtgj.fsf@kurt.kurt.home> (raw)
In-Reply-To: <20241021235535.603253-1-rosenp@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 969 bytes --]
On Mon Oct 21 2024, Rosen Penev wrote:
> These are the preferred way to copy ethtool strings.
>
> Avoids incrementing pointers all over the place.
>
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
[...]
> diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c
> index d798f17cf7ea..283ec5a6e23c 100644
> --- a/drivers/net/dsa/hirschmann/hellcreek.c
> +++ b/drivers/net/dsa/hirschmann/hellcreek.c
> @@ -294,12 +294,8 @@ static void hellcreek_get_strings(struct dsa_switch *ds, int port,
> {
> int i;
>
> - for (i = 0; i < ARRAY_SIZE(hellcreek_counter); ++i) {
> - const struct hellcreek_counter *counter = &hellcreek_counter[i];
> -
> - strscpy(data + i * ETH_GSTRING_LEN,
> - counter->name, ETH_GSTRING_LEN);
> - }
> + for (i = 0; i < ARRAY_SIZE(hellcreek_counter); ++i)
> + ethtool_puts(&data, hellcreek_counter[i].name);
> }
Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de> # hellcreek
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]
prev parent reply other threads:[~2024-10-22 8:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-21 23:55 Rosen Penev
2024-10-22 7:30 ` Geert Uytterhoeven
2024-10-22 8:29 ` Kurt Kanzenbach [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bjzcmtgj.fsf@kurt.kurt.home \
--to=kurt@linutronix.de \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=clement.leger@bootlin.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=florian.fainelli@broadcom.com \
--cc=george.mccollister@gmail.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=rosenp@gmail.com \
--cc=woojung.huh@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®