From: David Miller <davem@davemloft.net>
To: linus.walleij@linaro.org
Cc: netdev@vger.kernel.org, mirq-linux@rere.qmqm.pl,
janos.dev@gmail.com, paulius.zaleckas@gmail.com,
linux-arm-kernel@lists.infradead.org, ulli.kroll@googlemail.com,
f.fainelli@gmail.com, tobias.waldvogel@gmail.com
Subject: Re: [PATCH net-next 2/2 v6] net: ethernet: Add a driver for Gemini gigabit ethernet
Date: Wed, 06 Dec 2017 09:39:02 -0500 (EST) [thread overview]
Message-ID: <20171206.093902.2175928679170083415.davem@davemloft.net> (raw)
In-Reply-To: <CACRpkdbbcG8E6OCPb0Hgmp3owZqn2ab3hWEp1auwj-W_hMVbWw@mail.gmail.com>
From: Linus Walleij <linus.walleij@linaro.org>
Date: Wed, 6 Dec 2017 14:02:49 +0100
> On Mon, Dec 4, 2017 at 12:21 AM, David Miller <davem@davemloft.net> wrote:
>
>>> +static irqreturn_t gemini_port_irq_thread(int irq, void *data)
>>> +{
>>> + struct gemini_ethernet_port *port = data;
>>> + struct gemini_ethernet *geth = port->geth;
>>> + unsigned long irqmask = SWFQ_EMPTY_INT_BIT;
>>> + unsigned long flags;
>>
>> Always order local variables in reverse-christmas-tree format,
>> which is longest to shortest line.
>
> It's hard to do in cases like this where I use the variable
> when defining another variable:
>
> struct gemini_ethernet_port *port = netdev_priv(netdev);
> void __iomem *status_reg = port->gmac_base + GMAC_STATUS;
>
> But I understand the aesthetic, so I fix it as well as I can.
>
> If you want me to even rewrite the above using more lines of code
> to keep the aestetic (moving assignment out of the variable
> definitions), tell me and I can fix that too, whatever you like.
Yes, that is the way generally we recommend doing this. Move
the troublesome assignment down into the actual function body.
next prev parent reply other threads:[~2017-12-06 14:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-02 11:06 [PATCH net-next 1/2 v6] net: ethernet: Add DT bindings for the Gemini ethernet Linus Walleij
2017-12-02 11:06 ` [PATCH net-next 2/2 v6] net: ethernet: Add a driver for Gemini gigabit ethernet Linus Walleij
2017-12-03 23:21 ` David Miller
2017-12-06 13:02 ` Linus Walleij
2017-12-06 14:39 ` David Miller [this message]
2017-12-05 19:03 ` Michał Mirosław
2017-12-09 23:27 ` Linus Walleij
[not found] ` <20171202110640.5284-1-linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-12-04 18:06 ` [PATCH net-next 1/2 v6] net: ethernet: Add DT bindings for the Gemini ethernet Hans Ulli Kroll
2017-12-04 22:30 ` Rob Herring
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=20171206.093902.2175928679170083415.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=janos.dev@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mirq-linux@rere.qmqm.pl \
--cc=netdev@vger.kernel.org \
--cc=paulius.zaleckas@gmail.com \
--cc=tobias.waldvogel@gmail.com \
--cc=ulli.kroll@googlemail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).