[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241029155545.55ae9e30@kernel.org>
Date: Tue, 29 Oct 2024 15:55:45 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Rosen Penev <rosenp@...il.com>
Cc: netdev@...r.kernel.org, Andrew Lunn <andrew+netdev@...n.ch>, "David S.
Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo
Abeni <pabeni@...hat.com>, linux-kernel@...r.kernel.org (open list)
Subject: Re: [PATCH net-next] net: fjes: use ethtool string helpers
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
Powered by blists - more mailing lists