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: <Y1KFQ3emJhg8gXOj@shell.armlinux.org.uk>
Date:   Fri, 21 Oct 2022 12:40:51 +0100
From:   "Russell King (Oracle)" <linux@...linux.org.uk>
To:     Raju Lakkaraju <Raju.Lakkaraju@...rochip.com>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
        linux-kernel@...r.kernel.org, lxu@...linear.com,
        hkallweit1@...il.com, pabeni@...hat.com, edumazet@...gle.com,
        UNGLinuxDriver@...rochip.com, andrew@...n.ch,
        Ian.Saturley@...rochip.com
Subject: Re: [PATCH net-next] net: phy: mxl-gpy: Add PHY Auto/MDI/MDI-X set
 driver for GPY211 chips

Hi,

On Fri, Oct 21, 2022 at 03:33:05PM +0530, Raju Lakkaraju wrote:
> @@ -370,6 +415,38 @@ static int gpy_config_aneg(struct phy_device *phydev)
>  			      VSPEC1_SGMII_CTRL_ANRS, VSPEC1_SGMII_CTRL_ANRS);
>  }
>  
> +static void gpy_update_mdix(struct phy_device *phydev)
> +{
> +	int ret;
> +
> +	ret = phy_read(phydev, PHY_CTL1);
> +	if (ret < 0) {
> +		phydev_err(phydev, "Error: MDIO register access failed: %d\n",
> +			   ret);
> +		return;
> +	}
> +
> +	if (ret & PHY_CTL1_AMDIX)
> +		phydev->mdix_ctrl = ETH_TP_MDI_AUTO;
> +	else
> +		if (ret & PHY_CTL1_MDICD || ret & PHY_CTL1_MDIAB)
> +			phydev->mdix_ctrl = ETH_TP_MDI_X;
> +		else
> +			phydev->mdix_ctrl = ETH_TP_MDI;

I think this would be better formatted as:

	if (...)
		...
	else if (...)
		...
	else
		...

We don't indent unless there's braces, and if there's braces, coding
style advises braces on both sides of the "else". So, much better to
use the formatting I suggest above.

Apart from that, nothing stands out as being wrong in this patch.

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ