From: Andrew Lunn <andrew@lunn.ch>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: Wan Jiabing <wanjiabing@vivo.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kael_w@yeah.net
Subject: Re: [PATCH] FDDI: defxx: simplify if-if to if-else
Date: Mon, 25 Apr 2022 14:06:40 +0200 [thread overview]
Message-ID: <YmaO0PEZS6mjsHhO@lunn.ch> (raw)
In-Reply-To: <alpine.DEB.2.21.2204250009240.9383@angie.orcam.me.uk>
On Mon, Apr 25, 2022 at 12:26:10AM +0100, Maciej W. Rozycki wrote:
> On Mon, 25 Apr 2022, Andrew Lunn wrote:
>
> > > NAK. The first conditional optionally sets `bp->mmio = false', which
> > > changes the value of `dfx_use_mmio' in some configurations:
> > >
> > > #if defined(CONFIG_EISA) || defined(CONFIG_PCI)
> > > #define dfx_use_mmio bp->mmio
> > > #else
> > > #define dfx_use_mmio true
> > > #endif
> >
> > Which is just asking for trouble like this.
> >
> > Could i suggest dfx_use_mmio is changed to DFX_USE_MMIO to give a hint
> > something horrible is going on.
>
> There's legacy behind it, `dfx_use_mmio' used to be a proper variable and
> references were retained not to obfuscate the changes that ultimately led
> to the current arrangement. I guess at this stage it could be changed to
> a function-like macro or a static inline function taking `bp' as the
> argument.
Yes, something like that would be good.
> > It probably won't stop the robots finding this if (x) if (!x), but
> > there is a chance the robot drivers will wonder why it is upper case.
>
> Well, blindly relying on automation is bound to cause trouble.
Unfortunately, there are a number of bot drivers who do blindly rely
on automation. We have had to undo the same broken bot driven changes
a few times, and ended up adding extra comments to catch the eye of
the bot drivers.
Andrew
prev parent reply other threads:[~2022-04-25 12:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-24 9:28 [PATCH] FDDI: defxx: simplify if-if to if-else Wan Jiabing
2022-04-24 10:39 ` Maciej W. Rozycki
2022-04-24 22:17 ` Andrew Lunn
2022-04-24 23:26 ` Maciej W. Rozycki
2022-04-25 3:27 ` Jiabing Wan
2022-04-25 12:06 ` Andrew Lunn [this message]
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=YmaO0PEZS6mjsHhO@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=kael_w@yeah.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=macro@orcam.me.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=wanjiabing@vivo.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).