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

From: Jakub Kicinski
Date: Tue Oct 29 2024 - 18:55:53 EST


On Tue, 22 Oct 2024 13:54:31 -0700 Rosen Penev wrote:
> - for (i = 0; i < ARRAY_SIZE(fjes_gstrings_stats); i++) {
> - memcpy(p, fjes_gstrings_stats[i].stat_string,
> - ETH_GSTRING_LEN);
> - p += ETH_GSTRING_LEN;
> - }
> + for (i = 0; i < ARRAY_SIZE(fjes_gstrings_stats); i++)
> + ethtool_puts(&p, fjes_gstrings_stats[i].stat_string);
> +
> for (i = 0; i < hw->max_epid; i++) {
> if (i == hw->my_epid)
> continue;
> - sprintf(p, "ep%u_com_regist_buf_exec", i);
> - p += ETH_GSTRING_LEN;

In some of the other patches you deleted the local variable called p
and operate on data directly. I think that's better. Plus you can
remove the indentation here and exit early if stringset != ETH_SS_STATS
--
pw-bot: cr