lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YmXMcUAhUg/p1X3R@lunn.ch>
Date:   Mon, 25 Apr 2022 00:17:21 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     "Maciej W. Rozycki" <macro@...am.me.uk>
Cc:     Wan Jiabing <wanjiabing@...o.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, kael_w@...h.net
Subject: Re: [PATCH] FDDI: defxx: simplify if-if to if-else

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ