netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: stefanc@marvell.com
Cc: netdev@vger.kernel.org, thomas.petazzoni@bootlin.com,
	davem@davemloft.net, nadavh@marvell.com, ymarkman@marvell.com,
	linux-kernel@vger.kernel.org, kuba@kernel.org,
	linux@armlinux.org.uk, mw@semihalf.com,
	rmk+kernel@armlinux.org.uk, atenart@kernel.org,
	rabeeh@solid-run.com
Subject: Re: [net-next] net: mvpp2: Add reserved port private flag configuration
Date: Wed, 10 Mar 2021 16:50:45 +0100	[thread overview]
Message-ID: <YEjq1eehhA+8MYwH@lunn.ch> (raw)
In-Reply-To: <1615369329-9389-1-git-send-email-stefanc@marvell.com>

>  static void mvpp2_ethtool_get_strings(struct net_device *netdev, u32 sset,
>  				      u8 *data)
>  {
>  	struct mvpp2_port *port = netdev_priv(netdev);
>  	int i, q;
>  
> -	if (sset != ETH_SS_STATS)
> -		return;
> +	switch (sset) {
> +	case ETH_SS_STATS:
> +		for (i = 0; i < ARRAY_SIZE(mvpp2_ethtool_mib_regs); i++) {
> +			strscpy(data, mvpp2_ethtool_mib_regs[i].string,
> +				ETH_GSTRING_LEN);
> +			data += ETH_GSTRING_LEN;
> +		}

Hi Stefan

Maybe rename the existing function to
mvpp2_ethtool_get_strings_stats() and turn it into a helper. Add a new
mvpp2_ethtool_get_strings_priv() helper. And a new
mvpp2_ethtool_get_strings() which just calls the two helpers. Overall
the patch should be smaller and much easier to review.

    Andrew

  reply	other threads:[~2021-03-10 15:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10  9:42 [net-next] net: mvpp2: Add reserved port private flag configuration stefanc
2021-03-10 15:50 ` Andrew Lunn [this message]
2021-03-10 16:37   ` [EXT] " Stefan Chulski
2021-03-10 18:18     ` Andrew Lunn
2021-03-10 19:00 ` Russell King - ARM Linux admin
2021-03-11  8:12   ` [EXT] " Stefan Chulski

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=YEjq1eehhA+8MYwH@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=atenart@kernel.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mw@semihalf.com \
    --cc=nadavh@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=rabeeh@solid-run.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=stefanc@marvell.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=ymarkman@marvell.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).