Re: [PATCH net-next] net: dsa: use ethtool string helpers
From: Geert Uytterhoeven
Date: Tue Oct 22 2024 - 03:31:00 EST
Hi Rosen,
On Tue, Oct 22, 2024 at 1:55 AM Rosen Penev <rosenp@xxxxxxxxx> wrote:
> These are the preferred way to copy ethtool strings.
>
> Avoids incrementing pointers all over the place.
>
> Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
Thanks for your patch!
Only looking at the Renesas RZ/N1 driver...
> --- a/drivers/net/dsa/rzn1_a5psw.c
> +++ b/drivers/net/dsa/rzn1_a5psw.c
> @@ -803,8 +803,7 @@ static void a5psw_get_strings(struct dsa_switch *ds, int port, u32 stringset,
> return;
>
> for (u = 0; u < ARRAY_SIZE(a5psw_stats); u++) {
> - memcpy(data + u * ETH_GSTRING_LEN, a5psw_stats[u].name,
> - ETH_GSTRING_LEN);
> + ethtool_puts(&data, a5psw_stats[u].name);
> }
Please remove the curly braces, as they are no longer needed.
> }
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds