Thread (24 messages) 24 messages, 3 authors, 2019-02-28

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

From: Antoine Tenart <hidden>
Date: 2019-02-28 21:23:18
Also in: lkml

Hi David,

On Thu, Feb 28, 2019 at 10:40:51AM -0800, David Miller wrote:
From: Antoine Tenart <redacted>
Date: Thu, 28 Feb 2019 14:21:27 +0100
quoted
+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.

 ...
quoted
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help