Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1114520imm; Thu, 4 Oct 2018 08:23:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV61dq8dqihSsG/zAQ9po6JrNxnr8J6VqwtxBSBdRXuV7nEw4pcw/m8IHahcRueEtzPkNJ29E X-Received: by 2002:a62:2542:: with SMTP id l63-v6mr841977pfl.64.1538666590060; Thu, 04 Oct 2018 08:23:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538666590; cv=none; d=google.com; s=arc-20160816; b=jzJiySOMnzgGwtJDy/OBiXdFa+LydcD7wckPtRy8PHHLCPbWIzFZkpZvjfjtKuk3sc 9gSBuaZMbthP6mgB+ekkd1THIrKBQzCcJkkFEm5JkYGh+jTywd3cO3BYxJeDjyUvM4I4 pQcp5VJp7uO3AdZnWgaqjQ0rsTjW1fUSHyzrEtddvH8U5WO1xQLw2bWlu5qse81OgVWL y9qGjUlrtcsCo0iIRgKdJTxfqz8Of9tuiA/k5gbpLNDISEdo9eX2ylykAp8ox1lR9KTk QD+WKq/u+xQubryg0nQW8w2k7Aai7kCiVv5eyOhPWGXKFBsLe+2Kj+sGQniA7orJ7Bu+ W+Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tgpXLdfLLG4hLj1cneF7OCFoP4BlAXy1rzfT9rCcAUY=; b=tcHtS/aCDDwPKNCH83Sen1J40TRaMKE3tDMYxZHoMxN9XP184jxSKCVL8kajvchQOE 1NtPd6NtjZTWKaPO3eJ3Xc6CqbOIbiMY7yNwTqG5OXe13H9tT7s9pxBPEuVH/yQ/KKAC wG2WbFeriHV97sWaKtt2l5h1AWuTR2dCVj5D2G41qsZKbRCJ4GOuK4sKa28z/P1jEios mOiGQDLaLfk12KjjOO1TblNCDCbFqifKo4mludkcazrZ0UgOKuouXNPCse7oeAO0ipUE bDhcKRfLoKkKcABlal7uBnWo9koym89qrP8MOPJbcJfYP2jtoGgb8KnqaMRi3eOFKrWO EiOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Ua8MR0q+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g16-v6si5085043pgd.354.2018.10.04.08.22.54; Thu, 04 Oct 2018 08:23:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Ua8MR0q+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727773AbeJDWQ1 (ORCPT + 99 others); Thu, 4 Oct 2018 18:16:27 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:53857 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727454AbeJDWQ1 (ORCPT ); Thu, 4 Oct 2018 18:16:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=tgpXLdfLLG4hLj1cneF7OCFoP4BlAXy1rzfT9rCcAUY=; b=Ua8MR0q+ocXQgkjGu6JI8BMPO2lKFIYD+Puq08S3QexImnC5+7zQmIMu8ron0OQCXt8EVnqoBbp62FFT/MrbjUnIdAoAkR9HWa2jPVQ1UWL+pHdLXWRJYPGAoN0jJkJrBY3zPZBAylA51OXEpuZEb9YLTkq/efenPUv6gjMbUbI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1g85SX-0007HT-P4; Thu, 04 Oct 2018 17:22:37 +0200 Date: Thu, 4 Oct 2018 17:22:37 +0200 From: Andrew Lunn To: Quentin Schulz 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 Subject: Re: [PATCH net-next v2 2/6] net: phy: mscc: add ethtool statistics counters Message-ID: <20181004152237.GF4730@lunn.ch> References: <20181004124728.9821-1-quentin.schulz@bootlin.com> <20181004124728.9821-3-quentin.schulz@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181004124728.9821-3-quentin.schulz@bootlin.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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