netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: richard -rw- weinberger <richard.weinberger@gmail.com>
Cc: Jesper Juhl <jj@chaosbits.net>,
	netdev@vger.kernel.org, vortex@scyld.com, becker@scyld.com,
	Steffen Klassert <klassert@mathematik.tu-chemnitz.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 3c59x: Don't assign when a comparison is intended
Date: Sat, 25 Dec 2010 23:17:00 +0100	[thread overview]
Message-ID: <20101225221700.GA8612@pengutronix.de> (raw)
In-Reply-To: <AANLkTi=Y4wDG6+AY1=8NuFLGuCidgqaU1LginfB1YpZH@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1075 bytes --]

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@chaosbits.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/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

      parent reply	other threads:[~2010-12-25 22:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-25 20:30 [PATCH] 3c59x: Don't assign when a comparison is intended Jesper Juhl
2010-12-25 20:50 ` richard -rw- weinberger
2010-12-25 20:45   ` Jesper Juhl
2010-12-25 21:00     ` richard -rw- weinberger
2010-12-25 22:17   ` Wolfram Sang [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=20101225221700.GA8612@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=becker@scyld.com \
    --cc=jj@chaosbits.net \
    --cc=klassert@mathematik.tu-chemnitz.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=richard.weinberger@gmail.com \
    --cc=vortex@scyld.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).