netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Quentin Schulz <quentin.schulz@bootlin.com>
Cc: davem@davemloft.net, f.fainelli@gmail.com,
	allan.nielsen@microchip.com, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, thomas.petazzoni@bootlin.com,
	alexandre.belloni@bootlin.com,
	Raju Lakkaraju <Raju.Lakkaraju@microsemi.com>
Subject: Re: [PATCH net-next v2 2/6] net: phy: mscc: add ethtool statistics counters
Date: Thu, 4 Oct 2018 17:22:37 +0200	[thread overview]
Message-ID: <20181004152237.GF4730@lunn.ch> (raw)
In-Reply-To: <20181004124728.9821-3-quentin.schulz@bootlin.com>

On Thu, Oct 04, 2018 at 02:47:24PM +0200, Quentin Schulz wrote:

Hi Quentin

> +static u64 vsc85xx_get_stat(struct phy_device *phydev, int i)
> +{
> +	struct vsc8531_private *priv = phydev->priv;
> +	int val, oldpage;
> +	u64 ret;
> +
> +	oldpage = phy_select_page(phydev, priv->hw_stats[i].page);
> +
> +	val = __phy_read(phydev, priv->hw_stats[i].reg);
> +	if (val < 0) {
> +		ret = U64_MAX;
> +		goto out;
> +	}

phy_read_paged() should work here as well.

> +
> +	val = val & priv->hw_stats[i].mask;
> +	priv->stats[i] += val;
> +	ret = priv->stats[i];

Otherwise this looks good.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

  reply	other threads:[~2018-10-04 15:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 12:47 [PATCH net-next v2 0/6] net: phy: mscc: various improvements to Microsemi PHY driver Quentin Schulz
2018-10-04 12:47 ` [PATCH net-next v2 1/6] net: phy: mscc: migrate to phy_select/restore_page functions Quentin Schulz
2018-10-04 15:16   ` Andrew Lunn
2018-10-04 15:57     ` Quentin Schulz
2018-10-04 12:47 ` [PATCH net-next v2 2/6] net: phy: mscc: add ethtool statistics counters Quentin Schulz
2018-10-04 15:22   ` Andrew Lunn [this message]
2018-10-04 12:47 ` [PATCH net-next v2 3/6] net: phy: mscc: Add EEE init sequence Quentin Schulz
2018-10-04 12:47 ` [PATCH net-next v2 4/6] net: phy: mscc: remove unneeded parenthesis Quentin Schulz
2018-10-04 12:47 ` [PATCH net-next v2 5/6] net: phy: mscc: shorten `x != 0` condition to `x` Quentin Schulz
2018-10-04 12:47 ` [PATCH net-next v2 6/6] net: phy: mscc: remove unneeded temporary variable Quentin Schulz

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=20181004152237.GF4730@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Raju.Lakkaraju@microsemi.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=allan.nielsen@microchip.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=quentin.schulz@bootlin.com \
    --cc=thomas.petazzoni@bootlin.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).