All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rb532: fix irq number check in rb532_set_type
@ 2009-05-27 12:14 Florian Fainelli
  2009-05-27 13:15 ` Ralf Baechle
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2009-05-27 12:14 UTC (permalink / raw)
  To: ralf, linux-mips

We only have 14 GPIO interrupt sources numbered
from 0 to 13. Therefore the check against irq_nr
in rb532_set_type is off-by-one. This fixes a mistake
introduced by commit 1b4f571632ffb0caa4170d886694f2555c0d9a4b.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
diff --git a/arch/mips/rb532/irq.c b/arch/mips/rb532/irq.c
index 8ac4372..f078820 100644
--- a/arch/mips/rb532/irq.c
+++ b/arch/mips/rb532/irq.c
@@ -175,7 +175,7 @@ static int rb532_set_type(unsigned int irq_nr, unsigned type)
 	int gpio = irq_nr - GPIO_MAPPED_IRQ_BASE;
 	int group = irq_to_group(irq_nr);
 
-	if (group != GPIO_MAPPED_IRQ_GROUP || irq_nr >= (GROUP4_IRQ_BASE + 13))
+	if (group != GPIO_MAPPED_IRQ_GROUP || irq_nr > (GROUP4_IRQ_BASE + 13))
 		return (type == IRQ_TYPE_LEVEL_HIGH) ? 0 : -EINVAL;
 
 	switch (type) {

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

end of thread, other threads:[~2009-05-28 10:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-27 12:14 [PATCH] rb532: fix irq number check in rb532_set_type Florian Fainelli
2009-05-27 13:15 ` Ralf Baechle
2009-05-28 10:37   ` Florian Fainelli

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.