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
| ||
|
Message-ID: <20101225221700.GA8612@pengutronix.de>
Date: Sat, 25 Dec 2010 23:17:00 +0100
From: Wolfram Sang <w.sang@...gutronix.de>
To: richard -rw- weinberger <richard.weinberger@...il.com>
Cc: Jesper Juhl <jj@...osbits.net>, netdev@...r.kernel.org,
vortex@...ld.com, becker@...ld.com,
Steffen Klassert <klassert@...hematik.tu-chemnitz.de>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] 3c59x: Don't assign when a comparison is intended
On Sat, Dec 25, 2010 at 09:50:56PM +0100, richard -rw- weinberger wrote:
> On Sat, Dec 25, 2010 at 9:30 PM, Jesper Juhl <jj@...osbits.net> wrote:
> > Hi,
> >
> > In drivers/net/3c59x.c::vortex_probe1() we have this code:
> >
> > if (gendev) {
> > if ((pdev = DEVICE_PCI(gendev))) {
> > print_name = pci_name(pdev);
> > }
> >
> > if ((edev = DEVICE_EISA(gendev))) {
> > print_name = dev_name(&edev->dev);
> > }
> > }
> >
> > I believe these assignments were intended to be comparisons.
> > If I'm correct, then here's a patch to fix that up.
>
> I don't think so. Look at the extra brackets.
>
> The code can also written as:
>
> pdev = DEVICE_PCI(gendev);
> if(pdev)
> print_name = pci_name(pdev);
... which looks much better and could be worth a patch as well.
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (198 bytes)
Powered by blists - more mailing lists