lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210526123950.pcd563vozqgzsnsn@skbuf>
Date:   Wed, 26 May 2021 15:39:50 +0300
From:   Vladimir Oltean <olteanv@...il.com>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     Jakub Kicinski <kuba@...nel.org>,
        "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
        Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Vladimir Oltean <vladimir.oltean@....com>
Subject: Re: [PATCH net-next 02/13] net: dsa: sja1105: allow SGMII PCS
 configuration to be per port

On Mon, May 24, 2021 at 07:16:20PM -0700, Florian Fainelli wrote:
> 
> 
> On 5/24/2021 4:22 PM, Vladimir Oltean wrote:
> > From: Vladimir Oltean <vladimir.oltean@....com>
> > 
> > The SJA1105 R and S switches have 1 SGMII port (port 4). Because there
> > is only one such port, there is no "port" parameter in the configuration
> > code for the SGMII PCS.
> > 
> > However, the SJA1110 can have up to 4 SGMII ports, each with its own
> > SGMII register map. So we need to generalize the logic.
> > 
> > Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
> > ---
> [snip]
> >  
> > -	if (sja1105_supports_sgmii(priv, SJA1105_SGMII_PORT)) {
> > -		bool an_enabled = !!(bmcr & BMCR_ANENABLE);
> > +		if (!sja1105_supports_sgmii(priv, i))
> > +			continue;
> > +
> > +		an_enabled = !!(bmcr[i] & BMCR_ANENABLE);
> 
> Nit you could have a temporary bmcr variable here in the loop which
> aliases bmcr[i] just for the sake of reducing the diff to review.
> 
> Reviewed-by: Florian Fainelli <f.fainelli@...il.com>

I could have, but I don't have a good name for the bmcr array, and
"bmcr = bmcr_arr[i]" looks worse to me than just working with bmcr[i].

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ