Re: [PATCH net-next] net: dsa: use ethtool string helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>

[...]

> 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@xxxxxxxxxxxxx> # hellcreek

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux