[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87bjzcmtgj.fsf@kurt.kurt.home>
Date: Tue, 22 Oct 2024 10:29:16 +0200
From: Kurt Kanzenbach <kurt@...utronix.de>
To: Rosen Penev <rosenp@...il.com>, netdev@...r.kernel.org
Cc: Florian Fainelli <florian.fainelli@...adcom.com>, Andrew Lunn
<andrew@...n.ch>, Vladimir Oltean <olteanv@...il.com>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Woojung Huh
<woojung.huh@...rochip.com>, "maintainer:MICROCHIP KSZ SERIES ETHERNET
SWITCH DRIVER" <UNGLinuxDriver@...rochip.com>, Clément Léger
<clement.leger@...tlin.com>, George McCollister
<george.mccollister@...il.com>, Simon Horman <horms@...nel.org>, open list
<linux-kernel@...r.kernel.org>, "open list:RENESAS RZ/N1 A5PSW SWITCH
DRIVER" <linux-renesas-soc@...r.kernel.org>
Subject: Re: [PATCH net-next] net: dsa: use ethtool string helpers
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@...il.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@...utronix.de> # hellcreek
Download attachment "signature.asc" of type "application/pgp-signature" (862 bytes)
Powered by blists - more mailing lists