mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 00:17:21 +0200	[thread overview]
Message-ID: <YmXMcUAhUg/p1X3R@lunn.ch> (raw)
In-Reply-To: <alpine.DEB.2.21.2204241137440.9383@angie.orcam.me.uk>

On Sun, Apr 24, 2022 at 11:39:50AM +0100, Maciej W. Rozycki wrote:
> On Sun, 24 Apr 2022, Wan Jiabing wrote:
> 
> > diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c
> > index b584ffe38ad6..3edb2e96f763 100644
> > --- a/drivers/net/fddi/defxx.c
> > +++ b/drivers/net/fddi/defxx.c
> > @@ -585,10 +585,10 @@ static int dfx_register(struct device *bdev)
> >  			bp->mmio = false;
> >  			dfx_get_bars(bp, bar_start, bar_len);
> >  		}
> > -	}
> > -	if (!dfx_use_mmio)
> > +	} else {
> >  		region = request_region(bar_start[0], bar_len[0],
> >  					bdev->driver->name);
> > +	}
> 
>  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.

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.

	  Andrew

  reply	other threads:[~2022-04-24 22:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-24  9:28 Wan Jiabing
2022-04-24 10:39 ` Maciej W. Rozycki
2022-04-24 22:17   ` Andrew Lunn [this message]
2022-04-24 23:26     ` Maciej W. Rozycki
2022-04-25  3:27       ` Jiabing Wan
2022-04-25 12:06       ` Andrew Lunn

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=YmXMcUAhUg/p1X3R@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

all inboxes | Powered by JetHome®