Re: [PATCH net-next v8 6/9] net: txgbe: Support GPIO to SFP socket

Paolo Abeni
2023-05-16T09:40:04Z

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.

Cheers,

Paolo