* [PATCH] spi_mpc83xx: test below 0 on unsigned irq in mpc83xx_spi_probe()
@ 2008-04-23 20:19 Roel Kluin
2008-04-23 20:39 ` Kumar Gala
2008-04-23 20:55 ` [PATCH 2/2] xilinx_spi: test below 0 on unsigned irq in xilinx_spi_probe() Roel Kluin
0 siblings, 2 replies; 5+ messages in thread
From: Roel Kluin @ 2008-04-23 20:19 UTC (permalink / raw)
To: galak, linuxppc-dev; +Cc: lkml
mpc83xx_spi->irq is unsigned, so the test fails
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index be15a62..033fd51 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -454,12 +454,12 @@ static int __init mpc83xx_spi_probe(struct platform_device *dev)
goto put_master;
}
- mpc83xx_spi->irq = platform_get_irq(dev, 0);
-
- if (mpc83xx_spi->irq < 0) {
- ret = -ENXIO;
+ ret = platform_get_irq(dev, 0);
+ if (ret < 0)
goto unmap_io;
- }
+
+ mpc83xx_spi->irq = ret;
+ ret = 0;
/* Register for SPI Interrupt */
ret = request_irq(mpc83xx_spi->irq, mpc83xx_spi_irq,
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] spi_mpc83xx: test below 0 on unsigned irq in mpc83xx_spi_probe()
2008-04-23 20:19 [PATCH] spi_mpc83xx: test below 0 on unsigned irq in mpc83xx_spi_probe() Roel Kluin
@ 2008-04-23 20:39 ` Kumar Gala
2008-04-30 22:12 ` [spi-devel-general] " David Brownell
2008-04-23 20:55 ` [PATCH 2/2] xilinx_spi: test below 0 on unsigned irq in xilinx_spi_probe() Roel Kluin
1 sibling, 1 reply; 5+ messages in thread
From: Kumar Gala @ 2008-04-23 20:39 UTC (permalink / raw)
To: Roel Kluin; +Cc: linuxppc-dev@ozlabs.org list, lkml, spi-devel-general
On Apr 23, 2008, at 3:19 PM, Roel Kluin wrote:
> mpc83xx_spi->irq is unsigned, so the test fails
>
> Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
you should copy the linux-spi list on such patches.
- k
>
> ---
> diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
> index be15a62..033fd51 100644
> --- a/drivers/spi/spi_mpc83xx.c
> +++ b/drivers/spi/spi_mpc83xx.c
> @@ -454,12 +454,12 @@ static int __init mpc83xx_spi_probe(struct
> platform_device *dev)
> goto put_master;
> }
>
> - mpc83xx_spi->irq = platform_get_irq(dev, 0);
> -
> - if (mpc83xx_spi->irq < 0) {
> - ret = -ENXIO;
> + ret = platform_get_irq(dev, 0);
> + if (ret < 0)
> goto unmap_io;
> - }
> +
> + mpc83xx_spi->irq = ret;
> + ret = 0;
>
> /* Register for SPI Interrupt */
> ret = request_irq(mpc83xx_spi->irq, mpc83xx_spi_irq,
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] xilinx_spi: test below 0 on unsigned irq in xilinx_spi_probe()
2008-04-23 20:19 [PATCH] spi_mpc83xx: test below 0 on unsigned irq in mpc83xx_spi_probe() Roel Kluin
2008-04-23 20:39 ` Kumar Gala
@ 2008-04-23 20:55 ` Roel Kluin
2008-04-24 7:35 ` [PATCH 2/2 v2] " Roel Kluin
1 sibling, 1 reply; 5+ messages in thread
From: Roel Kluin @ 2008-04-23 20:55 UTC (permalink / raw)
To: dbrownell, spi-devel-general; +Cc: lkml
similarly,
---
xilinx_spi->irq is unsigned, so the test fails
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c
index cf6aef3..613db82 100644
--- a/drivers/spi/xilinx_spi.c
+++ b/drivers/spi/xilinx_spi.c
@@ -353,11 +353,12 @@ static int __init xilinx_spi_probe(struct platform_device *dev)
goto put_master;
}
- xspi->irq = platform_get_irq(dev, 0);
- if (xspi->irq < 0) {
- ret = -ENXIO;
+ ret = platform_get_irq(dev, 0);
+ if (ret < 0)
goto unmap_io;
- }
+
+ xspi->irq = ret;
+ ret = 0;
master->bus_num = pdata->bus_num;
master->num_chipselect = pdata->num_chipselect;
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2 v2] xilinx_spi: test below 0 on unsigned irq in xilinx_spi_probe()
2008-04-23 20:55 ` [PATCH 2/2] xilinx_spi: test below 0 on unsigned irq in xilinx_spi_probe() Roel Kluin
@ 2008-04-24 7:35 ` Roel Kluin
0 siblings, 0 replies; 5+ messages in thread
From: Roel Kluin @ 2008-04-24 7:35 UTC (permalink / raw)
To: dbrownell, spi-devel-general; +Cc: lkml
Joe Perches wrote:
> On Wed, 2008-04-23 at 22:55 +0200, Roel Kluin wrote:
>> - xspi->irq = platform_get_irq(dev, 0);
>> - if (xspi->irq < 0) {
>> - ret = -ENXIO;
>> + ret = platform_get_irq(dev, 0);
>> + if (ret < 0)
>> goto unmap_io;
>> - }
>> +
>> + xspi->irq = ret;
>> + ret = 0;
>
> Is the only negative return from platform_get_irq ENXIO?
> I think you still need the ret = -ENXIO before the goto.
>
> Also, you don't need the ret = 0 line, it's set again
> a few lines below.
>
> I think you should end up with:
>
> ret = platform_get_irq(dev, 0);
> if (ret < 0) {
> ret = -ENXIO;
> goto unmap_io;
> }
>
> xspi->irq = ret;
>
> cheers, Joe
In that case, this should suffice,
thanks again,
Roel
---
xilinx_spi->irq is unsigned, so the test fails
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c
index cf6aef3..2a471b3 100644
--- a/drivers/spi/xilinx_spi.c
+++ b/drivers/spi/xilinx_spi.c
@@ -353,11 +353,12 @@ static int __init xilinx_spi_probe(struct platform_device *dev)
goto put_master;
}
- xspi->irq = platform_get_irq(dev, 0);
- if (xspi->irq < 0) {
+ ret = platform_get_irq(dev, 0);
+ if (ret < 0) {
ret = -ENXIO;
goto unmap_io;
}
+ xspi->irq = ret;
master->bus_num = pdata->bus_num;
master->num_chipselect = pdata->num_chipselect;
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [spi-devel-general] [PATCH] spi_mpc83xx: test below 0 on unsigned irq in mpc83xx_spi_probe()
2008-04-23 20:39 ` Kumar Gala
@ 2008-04-30 22:12 ` David Brownell
0 siblings, 0 replies; 5+ messages in thread
From: David Brownell @ 2008-04-30 22:12 UTC (permalink / raw)
To: spi-devel-general
Cc: Kumar Gala, Roel Kluin, linuxppc-dev@ozlabs.org list, lkml
On Wednesday 23 April 2008, Kumar Gala wrote:
>
> On Apr 23, 2008, at 3:19 PM, Roel Kluin wrote:
> > mpc83xx_spi->irq is unsigned, so the test fails
> >
> > Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Any reason to not just make mpc83xx_spi->irq be "int",
following normal practice everywhere? If not, I'll
roll that into the patch from Joakim Tjernlund...
- Dave
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-04-30 22:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-23 20:19 [PATCH] spi_mpc83xx: test below 0 on unsigned irq in mpc83xx_spi_probe() Roel Kluin
2008-04-23 20:39 ` Kumar Gala
2008-04-30 22:12 ` [spi-devel-general] " David Brownell
2008-04-23 20:55 ` [PATCH 2/2] xilinx_spi: test below 0 on unsigned irq in xilinx_spi_probe() Roel Kluin
2008-04-24 7:35 ` [PATCH 2/2 v2] " Roel Kluin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox