spi_mpc83xx: test below 0 on unsigned irq in mpc83xx_spi_probe()
Subsystems (2)
PATCH 1/1 spi_mpc83xx: test below 0 on unsigned irq in mpc83xx_spi_probe()
mpc83xx_spi->irq is unsigned, so the test fails
---
drivers/spi/spi_mpc83xx.c +5 -5
@@ -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,
Quoted 3 lines · Roel Kluin
mpc83xx_spi->irqis unsigned, so the test failsSigned-off-by Roel Kluin <[email protected]>
you should copy the linux-spi list on such patches.
- k
Quoted 24 lines
---
drivers/spi/spi_mpc83xx.c +5
-5@@ -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 */
Quoted 1 line
ret = request_irq(mpc83xx_spi->irq, mpc83xx_spi_irq,
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Quoted 5 lines · Kumar Gala
Quoted 3 lines · Roel Kluin
mpc83xx_spi->irqis unsigned, so the test failsSigned-off-by Roel Kluin <[email protected]>
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
PATCH 2/2 xilinx_spi: test below 0 on unsigned irq in xilinx_spi_probe()
In reply to Roel Kluinsimilarly,
---xilinx_spi->irq is unsigned, so the test fails
---
drivers/spi/xilinx_spi.c +5 -4
@@ -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;
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
PATCH v2 2/2 xilinx_spi: test below 0 on unsigned irq in xilinx_spi_probe()
Quoted 29 lines · Joe Perches
Review
Quoted 10 lines · Roel Kluin
(quoted diff) +5
-4- 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_irqENXIO? I think you still need the ret =-ENXIObefore 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;
Quoted 1 line
cheers, Joe
In that case, this should suffice,
thanks again,
Roel
---xilinx_spi->irq is unsigned, so the test fails
---
drivers/spi/xilinx_spi.c +3 -2
@@ -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;
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone