Skip to contentSkip to conversation

rb532: fix irq number check in rb532_set_type

PATCH In review Florian Fainelli 2 participants 3 messages May 27, 2009 – May 28, 2009 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rb532: fix irq number check in rb532_set_type

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.

---

arch/mips/rb532/irq.c +1 -1
index 8ac4372..f078820 100644
@@ -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) {
#1 lore raw
Quoted 4 lines · Florian Fainelli

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.

Thanks; I've folded this patch into your old patch.

A note on commit IDs on the -queue tree. The -queue tree is really maintained in quilt and respun every time I change any of the commits on it. This means the commit IDs will also change, so they should be considered volatile.

Ralf

#2 lore raw

Le Wednesday 27 May 2009 15:15:35 Ralf Baechle, vous avez écrit :

Quoted 7 lines · Florian Fainelli
Quoted 4 lines

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.

Thanks; I've folded this patch into your old patch.

Thank you !

Quoted 5 lines

A note on commit IDs on the -queue tree. The -queue tree is really maintained in quilt and respun every time I change any of the commits on it. This means the commit IDs will also change, so they should be considered volatile.

I will take that into account next time, thanks for fixing this.

Signature · 4 lines
Best regards, Florian Fainelli
Email : [email protected]
http://openwrt.org
-------------------------------