Re: [PATCH net-next 14/15] net: mvpp2: set the XPCS and MPCS in reset when not used

From: Antoine Tenart
Date: Thu Feb 28 2019 - 16:23:20 EST


Hi David,

On Thu, Feb 28, 2019 at 10:40:51AM -0800, David Miller wrote:
> From: Antoine Tenart <antoine.tenart@xxxxxxxxxxx>
> Date: Thu, 28 Feb 2019 14:21:27 +0100
>
> > +static void mvpp22_pcs_reset(struct mvpp2_port *port)
> > +{
> > + struct mvpp2 *priv = port->priv;
> > + void __iomem *mpcs = priv->iface_base + MVPP22_MPCS_BASE(port->gop_id);
> > + void __iomem *xpcs = priv->iface_base + MVPP22_XPCS_BASE(port->gop_id);
> > + u32 val;
>
> Reverse christmas tree please.
>
> ...
> > +static void mvpp22_pcs_unreset(struct mvpp2_port *port)
> > +{
> > + struct mvpp2 *priv = port->priv;
> > + void __iomem *mpcs = priv->iface_base + MVPP22_MPCS_BASE(port->gop_id);
> > + void __iomem *xpcs = priv->iface_base + MVPP22_XPCS_BASE(port->gop_id);
> > + u32 val;
>
> Likewise.

Right. But here we do need priv to be assigned first in order to assign
mpcs and xpcs. Do you want the pointer definition and assignment to be
in two steps to respect the christmas tree rule or is it acceptable in
such situations?

Thanks!
Antoine

--
Antoine Ténart, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com