netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Rosen Penev <rosenp@gmail.com>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org (open list)
Subject: Re: [PATCH net-next] net: fjes: use ethtool string helpers
Date: Tue, 29 Oct 2024 15:55:45 -0700	[thread overview]
Message-ID: <20241029155545.55ae9e30@kernel.org> (raw)
In-Reply-To: <20241022205431.511859-1-rosenp@gmail.com>

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

      parent reply	other threads:[~2024-10-29 22:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-22 20:54 [PATCH net-next] net: fjes: use ethtool string helpers Rosen Penev
2024-10-24 11:03 ` Simon Horman
2024-10-29 22:55 ` Jakub Kicinski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241029155545.55ae9e30@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rosenp@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).