Re: [PATCH net-next v5 2/5] net: stmmac: introducing support for DWC xPCS logics

From: David Miller
Date: Mon Jun 03 2019 - 17:57:13 EST


From: Voon Weifeng <weifeng.voon@xxxxxxxxx>
Date: Sat, 1 Jun 2019 03:58:11 +0800

> +static void dw_xpcs_init(struct net_device *ndev, int pcs_mode)
> +{
> + struct stmmac_priv *priv = netdev_priv(ndev);
> + int xpcs_phy_addr = priv->plat->xpcs_phy_addr;
> + int phydata;

Reverse christmas tree please. Put the assignments onto separate
lines if necessary.

> +static void dw_xpcs_ctrl_ane(struct net_device *ndev, bool ane,
> + bool loopback)
> +{
> + struct stmmac_priv *priv = netdev_priv(ndev);
> + int xpcs_phy_addr = priv->plat->xpcs_phy_addr;
> +
> + int phydata = xpcs_read(XPCS_MDIO_MII_MMD, MII_BMCR);

Please don't break up the local variable declarations like this, and
also reverse christmas tree.

> +static void dw_xpcs_get_adv_lp(struct net_device *ndev,
> + struct rgmii_adv *adv_lp,
> + int pcs_mode)
> +{
> + struct stmmac_priv *priv = netdev_priv(ndev);
> + int xpcs_phy_addr = priv->plat->xpcs_phy_addr;
> +
> + /* AN Advertisement Ability */
> + int value = xpcs_read(XPCS_MDIO_MII_MMD, MII_ADVERTISE);

Likewise.

> +static int dw_xpcs_irq_status(struct net_device *ndev,
> + struct stmmac_extra_stats *x,
> + int pcs_mode)
> +{
> + struct stmmac_priv *priv = netdev_priv(ndev);
> + int xpcs_phy_addr = priv->plat->xpcs_phy_addr;
> + int ret = IRQ_NONE;
> +
> + /* AN status */
> + int an_stat = xpcs_read(XPCS_MDIO_MII_MMD, MDIO_MII_MMD_AN_STAT);

Likewise.