From: Andrew Morton <akpm@linux-foundation.org>
To: Borislav Petkov <bp@alien8.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, Andreas Mohr <andi@lisas.de>,
linux-kernel@vger.kernel.org, Li Shaohua <shaohua.li@intel.com>,
linux-acpi@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: Look Ma, da kernel is b0rken
Date: Wed, 5 Dec 2012 13:38:53 -0800 [thread overview]
Message-ID: <20121205133853.770451ca.akpm@linux-foundation.org> (raw)
In-Reply-To: <20121205153121.GA28556@liondog.tnic>
On Wed, 5 Dec 2012 16:31:21 +0100
Borislav Petkov <bp@alien8.de> wrote:
> On Wed, Dec 05, 2012 at 03:27:56PM +0000, Alan Cox wrote:
> > On Wed, 5 Dec 2012 15:29:35 +0100
> > Borislav Petkov <bp@alien8.de> wrote:
> >
> > > On Wed, Dec 05, 2012 at 08:09:01AM +0100, Andreas Mohr wrote:
> > > > Hi,
> > > >
> > > > drivers/pnp/pnpacpi/core.c: In function 'ispnpidacpi':
> > > > drivers/pnp/pnpacpi/core.c:65:2: warning: logical 'or' of collectively
> > > > exhaustive tests is always true [-Wlogical-op]
> > > > drivers/pnp/pnpacpi/core.c:66:2: warning: logical 'or' of collectively
> > > > exhaustive tests is always true [-Wlogical-op]
> > > > drivers/pnp/pnpacpi/core.c:67:2: warning: logical 'or' of collectively
> > > > exhaustive tests is always true [-Wlogical-op]
> > > >
> > > >
> > > > That's already the second less enticing -Wlogical-op issue
> > > > which was discovered by accident during less than two days
> >
> > No it's not. It's been reported in bugzilla. I sent patches ages ago.
> > They were ignored. Coverity has had it tagged for years (and a ton more
> > of them you've not noticed yet)
> >
> > http://article.gmane.org/gmane.linux.acpi.devel/56753/match=test_alpha
> >
> > This isn't discovered, this is in the "If you stick your fingers in your
> > ears and hum you can't hear the screaming" category.
>
> Hillarious!
>
> Andrew, would you please pick up Alan's patch? It clearly fixes an
> ancient bug in the pnpacpi code.
>
Bjorn had a review comment which appears to remain unaddressed:
: The original is definitely broken.
:
: I think the corrected test allows PNP IDs containing '@', which
: doesn't appear legal per sec 6.1.5 of the ACPI 5.0 spec. Should this
: be
:
: + if (!('A' <= (c) && (c) <= 'Z')) \
:
: instead?
Also, the original patch is missing a signed-off-by. Here's what I
have queued:
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: pnpacpi: fix incorrect TEST_ALPHA() test
TEST_ALPHA() is broken and always returns 0.
[akpm@linux-foundation.org: return false for '@' as well, per Bjorn]
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Andreas Mohr <andi@lisas.de>
Cc: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/pnp/pnpacpi/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -puN drivers/pnp/pnpacpi/core.c~pnpacpi-fix-incorrect-test_alpha-test drivers/pnp/pnpacpi/core.c
--- a/drivers/pnp/pnpacpi/core.c~pnpacpi-fix-incorrect-test_alpha-test
+++ a/drivers/pnp/pnpacpi/core.c
@@ -58,7 +58,7 @@ static inline int __init is_exclusive_de
if (!(('0' <= (c) && (c) <= '9') || ('A' <= (c) && (c) <= 'F'))) \
return 0
#define TEST_ALPHA(c) \
- if (!('@' <= (c) || (c) <= 'Z')) \
+ if (!('A' <= (c) && (c) <= 'Z')) \
return 0
static int __init ispnpidacpi(const char *id)
{
_
next prev parent reply other threads:[~2012-12-05 21:38 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-05 7:09 Look Ma, da kernel is b0rken Andreas Mohr
2012-12-05 14:29 ` Borislav Petkov
2012-12-05 15:27 ` Alan Cox
2012-12-05 15:31 ` Borislav Petkov
2012-12-05 15:47 ` Alan Cox
2012-12-05 15:59 ` Borislav Petkov
2012-12-05 17:04 ` Geert Uytterhoeven
2012-12-05 17:37 ` Borislav Petkov
2012-12-05 20:57 ` Stephen Rothwell
2012-12-05 21:12 ` Borislav Petkov
2012-12-05 21:41 ` Alan Cox
2012-12-05 21:46 ` Borislav Petkov
2012-12-05 21:39 ` Alan Cox
2012-12-05 21:38 ` Andrew Morton [this message]
2012-12-05 21:50 ` Borislav Petkov
2012-12-07 16:52 ` Andreas Mohr
2012-12-07 17:44 ` Borislav Petkov
2012-12-08 7:36 ` Andreas Mohr
2012-12-08 10:52 ` Borislav Petkov
2012-12-08 23:04 ` Alan Cox
2012-12-05 16:39 ` Andreas Mohr
2012-12-05 16:44 ` Borislav Petkov
2012-12-05 17:09 ` Andreas Mohr
2012-12-05 17:34 ` Borislav Petkov
2012-12-05 23:38 ` Rafael J. Wysocki
2012-12-05 23:35 ` Borislav Petkov
2012-12-06 14:04 ` Alan Cox
2012-12-06 20:56 ` Rafael J. Wysocki
2012-12-06 20:59 ` Borislav Petkov
2012-12-06 21:21 ` Rafael J. Wysocki
2012-12-06 21:20 ` Borislav Petkov
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=20121205133853.770451ca.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=andi@lisas.de \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shaohua.li@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.