* [PATCH] pnpacpi: incorrect test
@ 2012-10-29 16:05 Alan Cox
2012-10-30 19:05 ` Bjorn Helgaas
0 siblings, 1 reply; 2+ messages in thread
From: Alan Cox @ 2012-10-29 16:05 UTC (permalink / raw)
To: linux-acpi
From: Alan Cox <alan@linux.intel.com>
TEST_ALPHA() is broken and always returns 0
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=45171
---
drivers/pnp/pnpacpi/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index 26b5d4b..107b6b6 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -58,7 +58,7 @@ static inline int __init is_exclusive_device(struct acpi_device *dev)
if (!(('0' <= (c) && (c) <= '9') || ('A' <= (c) && (c) <= 'F'))) \
return 0
#define TEST_ALPHA(c) \
- if (!('@' <= (c) || (c) <= 'Z')) \
+ if (!('@' <= (c) && (c) <= 'Z')) \
return 0
static int __init ispnpidacpi(const char *id)
{
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pnpacpi: incorrect test
2012-10-29 16:05 [PATCH] pnpacpi: incorrect test Alan Cox
@ 2012-10-30 19:05 ` Bjorn Helgaas
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2012-10-30 19:05 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-acpi
On Mon, Oct 29, 2012 at 10:05 AM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> From: Alan Cox <alan@linux.intel.com>
>
> TEST_ALPHA() is broken and always returns 0
>
> Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=45171
> ---
>
> drivers/pnp/pnpacpi/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
> index 26b5d4b..107b6b6 100644
> --- a/drivers/pnp/pnpacpi/core.c
> +++ b/drivers/pnp/pnpacpi/core.c
> @@ -58,7 +58,7 @@ static inline int __init is_exclusive_device(struct acpi_device *dev)
> if (!(('0' <= (c) && (c) <= '9') || ('A' <= (c) && (c) <= 'F'))) \
> return 0
> #define TEST_ALPHA(c) \
> - if (!('@' <= (c) || (c) <= 'Z')) \
> + if (!('@' <= (c) && (c) <= 'Z')) \
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?
> return 0
> static int __init ispnpidacpi(const char *id)
> {
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-30 19:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-29 16:05 [PATCH] pnpacpi: incorrect test Alan Cox
2012-10-30 19:05 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox