public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: roel kluin <roel.kluin@gmail.com>
To: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: ralf@linux-mips.org, yoichi_yuasa@tripeaks.co.jp,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [MIPS] vr41xx: unsigned irq cannot be negative
Date: Tue, 16 Sep 2008 21:54:58 -0400	[thread overview]
Message-ID: <48D06372.3050809@gmail.com> (raw)
In-Reply-To: <48CF8E05.6050000@ru.mvista.com>

Sergei Shtylyov wrote:
> Hello.

>> @@ -79,8 +80,9 @@ static void irq_dispatch(unsigned int irq)
>>              desc->chip->mask(source_irq);
>>              desc->chip->ack(source_irq);
>>          }
>> -        irq = cascade->get_irq(irq);
>> -        if (irq < 0)
>> +        ret = cascade->get_irq(irq);
>> +        irq = ret;
>> +        if (ret < 0)
>>              atomic_inc(&irq_err_count);
>>          else
>>              irq_dispatch(irq);
>>   
> 
>  How about this:
> 
>         ret = cascade->get_irq(irq);
>         if (ret < 0)
>             atomic_inc(&irq_err_count);
>         else
>             irq_dispatch(ret);
> 
> 
> WBR, Sergei

good suggestion, but shouldn't we then remove source_irq
as well?

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/arch/mips/vr41xx/common/irq.c b/arch/mips/vr41xx/common/irq.c
index cba36a2..ab4e327 100644
--- a/arch/mips/vr41xx/common/irq.c
+++ b/arch/mips/vr41xx/common/irq.c
@@ -63,6 +63,7 @@ static void irq_dispatch(unsigned int irq)
 {
 	irq_cascade_t *cascade;
 	struct irq_desc *desc;
+	int ret;
 
 	if (irq >= NR_IRQS) {
 		atomic_inc(&irq_err_count);
@@ -71,21 +72,22 @@ static void irq_dispatch(unsigned int irq)
 
 	cascade = irq_cascade + irq;
 	if (cascade->get_irq != NULL) {
-		unsigned int source_irq = irq;
-		desc = irq_desc + source_irq;
+		desc = irq_desc + irq;
 		if (desc->chip->mask_ack)
-			desc->chip->mask_ack(source_irq);
+			desc->chip->mask_ack(irq);
 		else {
-			desc->chip->mask(source_irq);
-			desc->chip->ack(source_irq);
+			desc->chip->mask(irq);
+			desc->chip->ack(irq);
 		}
-		irq = cascade->get_irq(irq);
-		if (irq < 0)
+
+		ret = cascade->get_irq(irq);
+		if (ret < 0)
 			atomic_inc(&irq_err_count);
 		else
-			irq_dispatch(irq);
+			irq_dispatch(ret);
+
 		if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask)
-			desc->chip->unmask(source_irq);
+			desc->chip->unmask(irq);
 	} else
 		do_IRQ(irq);
 }


      reply	other threads:[~2008-09-16 19:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-16  0:50 [PATCH] [MIPS] vr41xx: unsigned irq cannot be negative roel kluin
2008-09-16  2:02 ` Yoichi Yuasa
2008-09-16  8:58 ` Ralf Baechle
2008-09-16 10:44 ` Sergei Shtylyov
2008-09-17  1:54   ` roel kluin [this message]

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=48D06372.3050809@gmail.com \
    --to=roel.kluin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=sshtylyov@ru.mvista.com \
    --cc=yoichi_yuasa@tripeaks.co.jp \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox