netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Rosen Penev <rosenp@gmail.com>
Cc: netdev@vger.kernel.org,
	"Florian Fainelli" <florian.fainelli@broadcom.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Kurt Kanzenbach" <kurt@linutronix.de>,
	"Woojung Huh" <woojung.huh@microchip.com>,
	"maintainer:MICROCHIP KSZ SERIES ETHERNET SWITCH DRIVER"
	<UNGLinuxDriver@microchip.com>,
	"Clément Léger" <clement.leger@bootlin.com>,
	"George McCollister" <george.mccollister@gmail.com>,
	"open list" <linux-kernel@vger.kernel.org>,
	"open list:RENESAS RZ/N1 A5PSW SWITCH DRIVER"
	<linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCHv3 net-next] net: dsa: use ethtool string helpers
Date: Fri, 25 Oct 2024 10:15:47 +0100	[thread overview]
Message-ID: <20241025091547.GJ1202098@kernel.org> (raw)
In-Reply-To: <20241024195238.176131-1-rosenp@gmail.com>

On Thu, Oct 24, 2024 at 12:52:38PM -0700, 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@gmail.com>
> Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>
> ---
>  v3: remove curly braces from ksz_common.c
>  v2: remove curly braces from rzn1_a5psw.c

...

> diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
> index 9201f07839ad..2bb1832d21bc 100644
> --- a/drivers/net/dsa/bcm_sf2.c
> +++ b/drivers/net/dsa/bcm_sf2.c
> @@ -1180,11 +1180,8 @@ static const struct b53_io_ops bcm_sf2_io_ops = {
>  static void bcm_sf2_sw_get_strings(struct dsa_switch *ds, int port,
>  				   u32 stringset, uint8_t *data)
>  {
> -	int cnt = b53_get_sset_count(ds, port, stringset);
> -
>  	b53_get_strings(ds, port, stringset, data);

Do you need to update b53_get_strings() so that you pass &data
rather than data? Otherwise, doesn't the call to bcm_sf2_cfp_get_strings()
overwrite what has been written by bcm_sf2_cfp_get_strings() ?

> -	bcm_sf2_cfp_get_strings(ds, port, stringset,
> -				data + cnt * ETH_GSTRING_LEN);
> +	bcm_sf2_cfp_get_strings(ds, port, stringset, data);
>  }
>  

...

  reply	other threads:[~2024-10-25  9:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24 19:52 [PATCHv3 net-next] net: dsa: use ethtool string helpers Rosen Penev
2024-10-25  9:15 ` Simon Horman [this message]
2024-10-25 19:58   ` Rosen Penev
2024-10-25  9:44 ` Kurt Kanzenbach

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=20241025091547.GJ1202098@kernel.org \
    --to=horms@kernel.org \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=clement.leger@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=george.mccollister@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=rosenp@gmail.com \
    --cc=woojung.huh@microchip.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).