Subject: Re: [PATCH net-next] net: hisilicon: hns3: use ethtool string helpers

From: Simon Horman <[email-masked]>
Date: Tue, 5 Nov 2024 14:00:43 +0000

On Fri, Nov 01, 2024 at 03:00:23PM -0700, Rosen Penev wrote:
> The latter is the preferred way to copy ethtool strings.
> 
> Avoids manually incrementing the pointer. Cleans up the code quite well.
> 
> Signed-off-by: Rosen Penev <[email-masked]>
> Reviewed-by: Jijie Shao <[email-masked]>
> Tested-by: Jijie Shao <[email-masked]>

...

> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
> index 97eaeec1952b..b6cc51bfdd33 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
> @@ -509,54 +509,38 @@ static int hns3_get_sset_count(struct net_device *netdev, int stringset)
>  	}
>  }
>  
> -static void *hns3_update_strings(u8 *data, const struct hns3_stats *stats,
> -		u32 stat_count, u32 num_tqps, const char *prefix)
> +static void hns3_update_strings(u8 **data, const struct hns3_stats *stats,
> +				u32 stat_count, u32 num_tqps,
> +				const char *prefix)
>  {
>  #define MAX_PREFIX_SIZE (6 + 4)

Hi Rosen,

As per Jakub's feedback on v1, can't this #define be removed?

...