From: Andrew Morton <akpm@linux-foundation.org>
To: David Miller <davem@davemloft.net>
Cc: linux-kernel@vger.kernel.org, hidave.darkstar@gmail.com
Subject: Re: + bluetooth-fix-warning-in-net-bluetooth-hci_sysfsc.patch added to -mm tree
Date: Sat, 16 Feb 2008 01:54:42 -0800 [thread overview]
Message-ID: <20080216015442.e94dc0ca.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080216.012741.243894500.davem@davemloft.net>
On Sat, 16 Feb 2008 01:27:41 -0800 (PST) David Miller <davem@davemloft.net> wrote:
> From: akpm@linux-foundation.org
> Date: Fri, 15 Feb 2008 20:49:33 -0800
>
> > Subject: bluetooth: fix warning in net/bluetooth/hci_sysfs.c
> > From: Andrew Morton <akpm@linux-foundation.org>
> >
> > net/bluetooth/hci_sysfs.c: In function 'del_conn':
> > net/bluetooth/hci_sysfs.c:339: warning: suggest parentheses around assignment used as truth value
> >
> > Cc: Dave Young <hidave.darkstar@gmail.com>
> > Cc: David S. Miller <davem@davemloft.net>
> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>
> Linus barfed when this exact patch got posted a few weeks
> ago, he said he considers just adding parenthesis to quiet
> this warning awful and explicit NULL test should be used.
- while (dev = device_find_child(&conn->dev, NULL, __match_tty)) {
+ while ((dev = device_find_child(&conn->dev, NULL, __match_tty))) {
hrm.
box:/usr/src/linux-2.6.25-rc2> grep -r 'while [(][(].*{$' . | wc -l
1240
box:/usr/src/linux-2.6.25-rc2> grep -r 'while [(][(].*{$' . | grep -v NULL | wc -l
867
so two thirds of them presently don't bother testing for NULL. It's a
pretty common idiom.
(adds the != NULL, sees that it reaches column 82, drops patch in disgust)
next prev parent reply other threads:[~2008-02-16 9:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200802160449.m1G4nX5V009024@imap1.linux-foundation.org>
2008-02-16 9:27 ` David Miller
2008-02-16 9:54 ` Andrew Morton [this message]
2008-02-16 12:03 ` Roel Kluin
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=20080216015442.e94dc0ca.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=hidave.darkstar@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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®