From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Raju Lakkaraju <Raju.Lakkaraju@microchip.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
linux-kernel@vger.kernel.org, lxu@maxlinear.com,
hkallweit1@gmail.com, pabeni@redhat.com, edumazet@google.com,
UNGLinuxDriver@microchip.com, andrew@lunn.ch,
Ian.Saturley@microchip.com
Subject: Re: [PATCH net-next] net: phy: mxl-gpy: Add PHY Auto/MDI/MDI-X set driver for GPY211 chips
Date: Fri, 21 Oct 2022 12:40:51 +0100 [thread overview]
Message-ID: <Y1KFQ3emJhg8gXOj@shell.armlinux.org.uk> (raw)
In-Reply-To: <20221021100305.6576-1-Raju.Lakkaraju@microchip.com>
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!
next prev parent reply other threads:[~2022-10-21 11:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-21 10:03 [PATCH net-next] net: phy: mxl-gpy: Add PHY Auto/MDI/MDI-X set driver for GPY211 chips Raju Lakkaraju
2022-10-21 11:40 ` Russell King (Oracle) [this message]
2022-10-21 14:01 ` Andrew Lunn
2022-10-24 7:24 ` Raju Lakkaraju
2022-10-24 11:54 ` Andrew Lunn
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=Y1KFQ3emJhg8gXOj@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=Ian.Saturley@microchip.com \
--cc=Raju.Lakkaraju@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lxu@maxlinear.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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).