linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix pnpacpi_parse_irq_option()'s test against PNP_IRQ_NR
@ 2008-06-27 12:33 David Howells
  2008-06-27 12:53 ` Rene Herman
  0 siblings, 1 reply; 8+ messages in thread
From: David Howells @ 2008-06-27 12:33 UTC (permalink / raw)
  To: bjorn.helgaas, rene.herman, len.brown; +Cc: linux-acpi, dhowells

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.  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@redhat.com>
---

 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)
+				__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);
 		}
 	}
 


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-06-27 15:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-27 12:33 [PATCH] Fix pnpacpi_parse_irq_option()'s test against PNP_IRQ_NR David Howells
2008-06-27 12:53 ` Rene Herman
2008-06-27 13:16   ` David Howells
2008-06-27 13:38     ` Rene Herman
2008-06-27 14:54       ` David Howells
2008-06-27 15:14         ` Bjorn Helgaas
2008-06-27 15:26         ` Rene Herman
2008-06-27 15:38           ` Rene Herman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).