lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdU7_6oDv1DKMAeCMoGWkakBn_vHpHsyvpjzUF3iaoJ=+g@mail.gmail.com>
Date: Wed, 23 Oct 2024 09:47:32 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Rosen Penev <rosenp@...il.com>
Cc: netdev@...r.kernel.org, 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>, 
	Kurt Kanzenbach <kurt@...utronix.de>, 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: [PATCHv2 net-next] net: dsa: use ethtool string helpers

Hi Rosen,

On Tue, Oct 22, 2024 at 10:16 PM Rosen Penev <rosenp@...il.com> wrote:
> These are the prefered way to copy ethtool strings.
>
> Avoids incrementing pointers all over the place.
>
> Signed-off-by: Rosen Penev <rosenp@...il.com>
> Reviewed-by: Kurt Kanzenbach <kurt@...utronix.de>
> ---
>  v2: remove curly braces from rzn1_a5psw.c

Thanks for the update!

> --- a/drivers/net/dsa/microchip/ksz_common.c
> +++ b/drivers/net/dsa/microchip/ksz_common.c
> @@ -2113,8 +2113,7 @@ static void ksz_get_strings(struct dsa_switch *ds, int port,
>                 return;
>
>         for (i = 0; i < dev->info->mib_cnt; i++) {
> -               memcpy(buf + i * ETH_GSTRING_LEN,
> -                      dev->info->mib_names[i].string, ETH_GSTRING_LEN);
> +               ethtool_puts(&buf, dev->info->mib_names[i].string);
>         }

This location could benefit from a similar change.

>  }
>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ