Re: [PATCH] Fix pnpacpi_parse_irq_option()'s test against PNP_IRQ_NR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 27-06-08 14:33, David Howells wrote:

Fix the test pnpacpi_parse_irq_option() makes against PNP_IRQ_NR by sticking
p->interrupt[i] into an unsigned int and then using it in the three places
that want it.

Pedantically, a simple unadorned int would be better it seems. The #define is an int, __set_bit(_) takes an int and an int is printed.

This gets rid of the warning:

drivers/pnp/pnpacpi/rsparser.c:500: warning: comparison is always true due to limited range of data type

Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
---

 drivers/pnp/pnpacpi/rsparser.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)


diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index d2abc87..b0d89eb 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -497,12 +497,13 @@ static __init void pnpacpi_parse_irq_option(struct pnp_dev *dev,
 	bitmap_zero(map.bits, PNP_IRQ_NR);
 	for (i = 0; i < p->interrupt_count; i++) {
 		if (p->interrupts[i]) {
-			if (p->interrupts[i] < PNP_IRQ_NR)
-				__set_bit(p->interrupts[i], map.bits);
+			unsigned irq = p->interrupts[i];
+			if (irq  < PNP_IRQ_NR)

Hyper-pedantically, this adds one space too many :-)

+				__set_bit(irq, map.bits);
 			else
 				dev_err(&dev->dev, "ignoring IRQ %d option "
 					"(too large for %d entry bitmap)\n",
-					p->interrupts[i], PNP_IRQ_NR);
+					irq, PNP_IRQ_NR);
 		}
 	}

Rene.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux