From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Paolo Abeni <pabeni@redhat.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
Jiawen Wu <jiawenwu@trustnetic.com>,
netdev@vger.kernel.org, jarkko.nikula@linux.intel.com,
andriy.shevchenko@linux.intel.com,
mika.westerberg@linux.intel.com, jsd@semihalf.com,
Jose.Abreu@synopsys.com, andrew@lunn.ch, hkallweit1@gmail.com,
linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org,
mengyuanlou@net-swift.com
Subject: Re: [PATCH net-next v8 6/9] net: txgbe: Support GPIO to SFP socket
Date: Tue, 16 May 2023 11:31:11 +0100 [thread overview]
Message-ID: <ZGNbb2Oe9aLIT04p@shell.armlinux.org.uk> (raw)
In-Reply-To: <aed598bbe094633859f477dd99ff7d086261b071.camel@redhat.com>
On Tue, May 16, 2023 at 11:39:08AM +0200, Paolo Abeni wrote:
> On Tue, 2023-05-16 at 10:12 +0300, Andy Shevchenko wrote:
> > On Tue, May 16, 2023 at 5:39 AM Jiawen Wu <jiawenwu@trustnetic.com> wrote:
> >
> > ...
> >
> > > > > + struct gpio_irq_chip *girq;
> > > > > + struct wx *wx = txgbe->wx;
> > > > > + struct gpio_chip *gc;
> > > > > + struct device *dev;
> > > > > + int ret;
> > > >
> > > > > + dev = &wx->pdev->dev;
> > > >
> > > > This can be united with the defintion above.
> > > >
> > > > struct device *dev = &wx->pdev->dev;
> > > >
> > >
> > > This is a question that I often run into, when I want to keep this order,
> > > i.e. lines longest to shortest, but the line of the pointer which get later
> > > is longer. For this example:
> > >
> > > struct wx *wx = txgbe->wx;
> > > struct device *dev = &wx->pdev->dev;
> >
> > So, we locate assignments according to the flow. I do not see an issue here.
>
> That would break the reverse x-mass tree order.
>
> > > should I split the line, or put the long line abruptly there?
> >
> > The latter is fine.
>
> This is minor, but I have to disagree. My understanding is that
> respecting the reversed x-mass tree is preferred. In case of dependent
> initialization as the above, the preferred style it the one used by
> this patch.
Meanwhile, I've been told something completely different, and therefore
I do something else, namely:
struct device *dev;
struct wx *wx;
wx = txgbe->wx;
dev = &wx->pdev->dev;
...
I've been lead to believe that this is preferred in netdev to breaking
the reverse christmas-tree due to dependent initialisations.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2023-05-16 10:32 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-15 6:31 [PATCH net-next v8 0/9] TXGBE PHYLINK support Jiawen Wu
2023-05-15 6:31 ` [PATCH net-next v8 1/9] net: txgbe: Add software nodes to support phylink Jiawen Wu
2023-05-15 6:31 ` [PATCH net-next v8 2/9] i2c: designware: Add driver support for Wangxun 10Gb NIC Jiawen Wu
2023-05-15 9:24 ` andy.shevchenko
2023-05-17 8:49 ` Jarkko Nikula
2023-05-17 9:25 ` Jiawen Wu
2023-05-17 9:44 ` Andy Shevchenko
2023-05-19 13:26 ` Jarkko Nikula
2023-05-17 9:40 ` Andy Shevchenko
2023-05-15 6:31 ` [PATCH net-next v8 3/9] net: txgbe: Register fixed rate clock Jiawen Wu
2023-05-15 6:31 ` [PATCH net-next v8 4/9] net: txgbe: Register I2C platform device Jiawen Wu
2023-05-15 9:29 ` andy.shevchenko
2023-05-15 6:31 ` [PATCH net-next v8 5/9] net: txgbe: Add SFP module identify Jiawen Wu
2023-05-15 6:31 ` [PATCH net-next v8 6/9] net: txgbe: Support GPIO to SFP socket Jiawen Wu
2023-05-15 9:42 ` andy.shevchenko
2023-05-16 2:38 ` Jiawen Wu
2023-05-16 7:12 ` Andy Shevchenko
2023-05-16 9:39 ` Paolo Abeni
2023-05-16 10:31 ` Russell King (Oracle) [this message]
2023-05-17 2:55 ` Jiawen Wu
2023-05-17 10:26 ` Andy Shevchenko
2023-05-17 15:00 ` Andrew Lunn
2023-05-18 11:49 ` Jiawen Wu
2023-05-18 12:27 ` Andy Shevchenko
2023-05-18 16:02 ` Michael Walle
2023-05-18 16:07 ` Andy Shevchenko
2023-05-23 9:55 ` Jiawen Wu
2023-05-23 11:07 ` Andy Shevchenko
2023-05-23 11:10 ` Andy Shevchenko
2023-05-18 12:48 ` Andrew Lunn
2023-05-19 2:25 ` Jiawen Wu
2023-05-19 13:13 ` Andrew Lunn
2023-05-22 9:00 ` Jiawen Wu
2023-05-22 9:06 ` Jiawen Wu
2023-05-22 10:58 ` Jiawen Wu
2023-05-22 21:36 ` 'Andy Shevchenko'
2023-05-23 2:08 ` Jiawen Wu
2023-05-23 6:12 ` Jiawen Wu
2023-05-19 8:24 ` Jiawen Wu
2023-05-19 8:51 ` Jiawen Wu
2023-05-19 13:24 ` Andrew Lunn
2023-05-15 21:36 ` Andy Shevchenko
2023-05-16 2:05 ` Jiawen Wu
2023-05-17 10:29 ` 'Andy Shevchenko'
2023-05-15 6:31 ` [PATCH net-next v8 7/9] net: pcs: Add 10GBASE-R mode for Synopsys Designware XPCS Jiawen Wu
2023-05-15 6:31 ` [PATCH net-next v8 8/9] net: txgbe: Implement phylink pcs Jiawen Wu
2023-05-16 2:45 ` Lars-Peter Clausen
2023-05-15 6:32 ` [PATCH net-next v8 9/9] net: txgbe: Support phylink MAC layer Jiawen Wu
2023-05-16 9:43 ` Paolo Abeni
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=ZGNbb2Oe9aLIT04p@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=Jose.Abreu@synopsys.com \
--cc=andrew@lunn.ch \
--cc=andriy.shevchenko@linux.intel.com \
--cc=andy.shevchenko@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=jiawenwu@trustnetic.com \
--cc=jsd@semihalf.com \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=mengyuanlou@net-swift.com \
--cc=mika.westerberg@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.