public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nios2: fix error handling of irq_of_parse_and_map
@ 2014-11-14 22:04 Dmitry Torokhov
  2014-11-17  9:24 ` Tobias Klauser
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2014-11-14 22:04 UTC (permalink / raw)
  To: Ley Foon Tan; +Cc: nios2-dev, linux-kernel

Return value of irq_of_parse_and_map() is unsigned int, with 0
indicating failure, so testing for negative result never works.

Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
---

Not tested, found by casual code inspection.

 arch/nios2/kernel/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/nios2/kernel/time.c b/arch/nios2/kernel/time.c
index d90ca1b..23729e8 100644
--- a/arch/nios2/kernel/time.c
+++ b/arch/nios2/kernel/time.c
@@ -228,7 +228,7 @@ static __init void nios2_clockevent_init(struct device_node *timer)
 	nios2_timer_get_base_and_freq(timer, &iobase, &freq);
 
 	irq = irq_of_parse_and_map(timer, 0);
-	if (irq < 0)
+	if (!irq)
 		panic("Unable to parse timer irq\n");
 
 	nios2_ce.timer.base = iobase;
-- 
2.1.0.rc2.206.gedb03e5


-- 
Dmitry

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

* Re: [PATCH] nios2: fix error handling of irq_of_parse_and_map
  2014-11-14 22:04 [PATCH] nios2: fix error handling of irq_of_parse_and_map Dmitry Torokhov
@ 2014-11-17  9:24 ` Tobias Klauser
  2014-11-17 10:04   ` Ley Foon Tan
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Klauser @ 2014-11-17  9:24 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Ley Foon Tan, nios2-dev, linux-kernel

On 2014-11-14 at 23:04:19 +0100, Dmitry Torokhov <dtor@chromium.org> wrote:
> Return value of irq_of_parse_and_map() is unsigned int, with 0
> indicating failure, so testing for negative result never works.
> 
> Signed-off-by: Dmitry Torokhov <dtor@chromium.org>

Reviewed-by: Tobias Klauser <tklauser@distanz.ch>

Thanks for catching this.

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

* Re: [PATCH] nios2: fix error handling of irq_of_parse_and_map
  2014-11-17  9:24 ` Tobias Klauser
@ 2014-11-17 10:04   ` Ley Foon Tan
  0 siblings, 0 replies; 3+ messages in thread
From: Ley Foon Tan @ 2014-11-17 10:04 UTC (permalink / raw)
  To: Tobias Klauser
  Cc: Dmitry Torokhov, nios2-dev@lists.rocketboards.org,
	linux-kernel@vger.kernel.org

On Mon, Nov 17, 2014 at 5:24 PM, Tobias Klauser <tklauser@distanz.ch> wrote:
> On 2014-11-14 at 23:04:19 +0100, Dmitry Torokhov <dtor@chromium.org> wrote:
>> Return value of irq_of_parse_and_map() is unsigned int, with 0
>> indicating failure, so testing for negative result never works.
>>
>> Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
>
> Reviewed-by: Tobias Klauser <tklauser@distanz.ch>
>
> Thanks for catching this.
Thanks for your patch.

Regards
Ley Foon

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

end of thread, other threads:[~2014-11-17 10:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-14 22:04 [PATCH] nios2: fix error handling of irq_of_parse_and_map Dmitry Torokhov
2014-11-17  9:24 ` Tobias Klauser
2014-11-17 10:04   ` Ley Foon Tan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox