From: Linus Torvalds <torvalds@linux-foundation.org>
To: Michael K?hn <breiteseite1337@googlemail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] 2.6.24, net/bluetooth/hci_sysfs.c, cleaned code remove compiler warning
Date: Sat, 26 Jan 2008 23:00:00 -0800 (PST) [thread overview]
Message-ID: <alpine.LFD.1.00.0801262256070.3222@www.l.google.com> (raw)
In-Reply-To: <479BF21B.8070104@googlemail.com>
On Sun, 27 Jan 2008, Michael K?hn wrote:
>
> the attached Patch will remove a compiler warning in
> net/bluetooth/hci_sysfs.c:
Please don't do this. I realize that gcc suggests just adding parenthesis,
and yes, it makes the warning go away, but it's not sensible from a human
semantic standpoint.
So if the warning bothers you, please change
while (dev = device_find_child(..)) {
into something like
while ((dev = device_find_child(..)) != NULL) {
which also gets rid of the warning, but now does it with something that
makes sense to a human too.
Just arbitrarily adding another set of parentheses never made much sense
to me. It's semantically still the exact same expression, just the fact
that gcc suddenly doesn't warn about the assignment because it's "hidden"
by the extra parenthesis is just odd.
Linus
prev parent reply other threads:[~2008-01-27 7:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-27 2:53 Michael Kühn
2008-01-27 7:00 ` Linus Torvalds [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=alpine.LFD.1.00.0801262256070.3222@www.l.google.com \
--to=torvalds@linux-foundation.org \
--cc=breiteseite1337@googlemail.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®