netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: Fix checks on unsigned in w90p910_ether_probe()
@ 2009-10-20 18:14 Roel Kluin
  2009-10-30  6:06 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Roel Kluin @ 2009-10-20 18:14 UTC (permalink / raw)
  To: netdev, Andrew Morton, mcuos.com, davem

ether->txirq and ->rxirq are unsigned

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/net/arm/w90p910_ether.c b/drivers/net/arm/w90p910_ether.c
index 25e2627..503c2ce 100644
--- a/drivers/net/arm/w90p910_ether.c
+++ b/drivers/net/arm/w90p910_ether.c
@@ -981,7 +981,7 @@ static int __devinit w90p910_ether_probe(struct platform_device *pdev)
 {
 	struct w90p910_ether *ether;
 	struct net_device *dev;
-	int error;
+	int error, ret;
 
 	dev = alloc_etherdev(sizeof(struct w90p910_ether));
 	if (!dev)
@@ -1010,17 +1010,19 @@ static int __devinit w90p910_ether_probe(struct platform_device *pdev)
 		goto failed_free_mem;
 	}
 
-	ether->txirq = platform_get_irq(pdev, 0);
-	if (ether->txirq < 0) {
+	ret = platform_get_irq(pdev, 0);
+	ether->txirq = ret;
+	if (ret < 0) {
 		dev_err(&pdev->dev, "failed to get ether tx irq\n");
-		error = -ENXIO;
+		error = ret;
 		goto failed_free_io;
 	}
 
-	ether->rxirq = platform_get_irq(pdev, 1);
-	if (ether->rxirq < 0) {
+	ret = platform_get_irq(pdev, 1);
+	ether->rxirq = ret;
+	if (ret < 0) {
 		dev_err(&pdev->dev, "failed to get ether rx irq\n");
-		error = -ENXIO;
+		error = ret;
 		goto failed_free_txirq;
 	}
 

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

* Re: [PATCH] net: Fix checks on unsigned in w90p910_ether_probe()
  2009-10-20 18:14 [PATCH] net: Fix checks on unsigned in w90p910_ether_probe() Roel Kluin
@ 2009-10-30  6:06 ` David Miller
  2009-10-30  6:18   ` Wan ZongShun
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2009-10-30  6:06 UTC (permalink / raw)
  To: roel.kluin; +Cc: netdev, akpm, mcuos.com

From: Roel Kluin <roel.kluin@gmail.com>
Date: Tue, 20 Oct 2009 20:14:36 +0200

> ether->txirq and ->rxirq are unsigned
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

platform_get_irq() returns a signed int so the intention
is more likely that catching negative value returns
was intended.

Probably the correct fix is to mark txirq and rxirq as
plain 'int'.

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

* Re: [PATCH] net: Fix checks on unsigned in w90p910_ether_probe()
  2009-10-30  6:06 ` David Miller
@ 2009-10-30  6:18   ` Wan ZongShun
  0 siblings, 0 replies; 3+ messages in thread
From: Wan ZongShun @ 2009-10-30  6:18 UTC (permalink / raw)
  To: David Miller, roel.kluin; +Cc: netdev, akpm, linux-arm-kernel

Dear sirs,

Okay, it is right, thanks all for your help.
I will re-fix it later.

2009/10/30, David Miller <davem@davemloft.net>:
> From: Roel Kluin <roel.kluin@gmail.com>
> Date: Tue, 20 Oct 2009 20:14:36 +0200
>
> > ether->txirq and ->rxirq are unsigned
> >
> > Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
>
> platform_get_irq() returns a signed int so the intention
> is more likely that catching negative value returns
> was intended.
>
> Probably the correct fix is to mark txirq and rxirq as
> plain 'int'.
>


-- 
Wan z.s

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

end of thread, other threads:[~2009-10-30  6:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-20 18:14 [PATCH] net: Fix checks on unsigned in w90p910_ether_probe() Roel Kluin
2009-10-30  6:06 ` David Miller
2009-10-30  6:18   ` Wan ZongShun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).