All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <florian@openwrt.org>
To: ralf@linux-mips.org, linux-mips@linux-mips.org
Subject: [PATCH] rb532: fix irq number check in rb532_set_type
Date: Wed, 27 May 2009 14:14:06 +0200	[thread overview]
Message-ID: <200905271414.07074.florian@openwrt.org> (raw)

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) {

             reply	other threads:[~2009-05-27 12:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-27 12:14 Florian Fainelli [this message]
2009-05-27 13:15 ` [PATCH] rb532: fix irq number check in rb532_set_type Ralf Baechle
2009-05-28 10:37   ` Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200905271414.07074.florian@openwrt.org \
    --to=florian@openwrt.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.