* [PATCH] asic3: platform_get_irq() may return signed unnoticed
@ 2008-04-23 21:32 Roel Kluin
2008-04-23 22:38 ` [PATCH v2] " Roel Kluin
0 siblings, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2008-04-23 21:32 UTC (permalink / raw)
To: pb, sameo, lkml
asic->irq_nr is unsigned. platform_get_irq() may return signed unnoticed
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index f6f2d96..95f7b0c 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -302,7 +302,7 @@ static int asic3_irq_probe(struct platform_device *pdev)
unsigned int irq, irq_base;
asic->irq_nr = platform_get_irq(pdev, 0);
- if (asic->irq_nr < 0)
+ if (asic->irq_nr == -ENXIO)
return asic->irq_nr;
/* turn on clock to IRQ controller */
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2] asic3: platform_get_irq() may return signed unnoticed
2008-04-23 21:32 [PATCH] asic3: platform_get_irq() may return signed unnoticed Roel Kluin
@ 2008-04-23 22:38 ` Roel Kluin
2008-04-23 22:58 ` Roel Kluin
0 siblings, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2008-04-23 22:38 UTC (permalink / raw)
To: pb, sameo, lkml
asic->irq_nr is unsigned. platform_get_irq() may return signed unnoticed
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index f6f2d96..8068c06 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -300,10 +300,13 @@ static int asic3_irq_probe(struct platform_device *pdev)
struct asic3 *asic = platform_get_drvdata(pdev);
unsigned long clksel = 0;
unsigned int irq, irq_base;
+ int ret;
- asic->irq_nr = platform_get_irq(pdev, 0);
- if (asic->irq_nr < 0)
+ ret = platform_get_irq(pdev, 0);
+ if (ret < 0)
return asic->irq_nr;
+ else
+ asic->irq_nr = ret;
/* turn on clock to IRQ controller */
clksel |= CLOCK_SEL_CX;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] asic3: platform_get_irq() may return signed unnoticed
2008-04-23 22:38 ` [PATCH v2] " Roel Kluin
@ 2008-04-23 22:58 ` Roel Kluin
2008-04-23 23:16 ` Samuel Ortiz
0 siblings, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2008-04-23 22:58 UTC (permalink / raw)
To: pb, sameo, lkml
Thanks to Joe Perches for catching an error in my previous
---
asic->irq_nr is unsigned. platform_get_irq() may return signed unnoticed
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index f6f2d96..abd7ffc 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -300,10 +300,13 @@ static int asic3_irq_probe(struct platform_device *pdev)
struct asic3 *asic = platform_get_drvdata(pdev);
unsigned long clksel = 0;
unsigned int irq, irq_base;
+ int ret;
+
+ ret = platform_get_irq(pdev, 0);
+ if (ret < 0)
+ return ret;
- asic->irq_nr = platform_get_irq(pdev, 0);
- if (asic->irq_nr < 0)
- return asic->irq_nr;
+ asic->irq_nr = ret;
/* turn on clock to IRQ controller */
clksel |= CLOCK_SEL_CX;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] asic3: platform_get_irq() may return signed unnoticed
2008-04-23 22:58 ` Roel Kluin
@ 2008-04-23 23:16 ` Samuel Ortiz
0 siblings, 0 replies; 4+ messages in thread
From: Samuel Ortiz @ 2008-04-23 23:16 UTC (permalink / raw)
To: Roel Kluin; +Cc: pb, lkml
On Thu, Apr 24, 2008 at 12:58:02AM +0200, Roel Kluin wrote:
> Thanks to Joe Perches for catching an error in my previous
Yep, that makes sense now.
> ---
> asic->irq_nr is unsigned. platform_get_irq() may return signed unnoticed
>
> Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Acked-by: Samuel Ortiz <sameo@openedhand.com>
> ---
> diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
> index f6f2d96..abd7ffc 100644
> --- a/drivers/mfd/asic3.c
> +++ b/drivers/mfd/asic3.c
> @@ -300,10 +300,13 @@ static int asic3_irq_probe(struct platform_device *pdev)
> struct asic3 *asic = platform_get_drvdata(pdev);
> unsigned long clksel = 0;
> unsigned int irq, irq_base;
> + int ret;
> +
> + ret = platform_get_irq(pdev, 0);
> + if (ret < 0)
> + return ret;
>
> - asic->irq_nr = platform_get_irq(pdev, 0);
> - if (asic->irq_nr < 0)
> - return asic->irq_nr;
> + asic->irq_nr = ret;
>
> /* turn on clock to IRQ controller */
> clksel |= CLOCK_SEL_CX;
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-04-23 23:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-23 21:32 [PATCH] asic3: platform_get_irq() may return signed unnoticed Roel Kluin
2008-04-23 22:38 ` [PATCH v2] " Roel Kluin
2008-04-23 22:58 ` Roel Kluin
2008-04-23 23:16 ` Samuel Ortiz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox