Skip to contentSkip to conversation

gianfar: fix signedness issue

PATCH In review Nicolas Kaiser 2 participants 2 messages Nov 15, 2010 – Nov 17, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gianfar: fix signedness issue

irq_of_parse_and_map() has an unsigned return type. Testing for a negative error value doesn't work here.

---
I see that in numerous places the return value is tested for NO_IRQ. I hope it's the right thing to do here as well?

 drivers/net/gianfar.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/net/gianfar.c +3 -4
index 49e4ce1..d1bec62 100644
@@ -577,11 +577,10 @@ static int gfar_parse_group(struct device_node *np,
 			irq_of_parse_and_map(np, 1);
 		priv->gfargrp[priv->num_grps].interruptError  			irq_of_parse_and_map(np,2);
-		if (priv->gfargrp[priv->num_grps].interruptTransmit < 0 ||
-			priv->gfargrp[priv->num_grps].interruptReceive < 0 ||
-			priv->gfargrp[priv->num_grps].interruptError < 0) {
+		if (priv->gfargrp[priv->num_grps].interruptTransmit = NO_IRQ ||
+		    priv->gfargrp[priv->num_grps].interruptReceive  = NO_IRQ ||
+		    priv->gfargrp[priv->num_grps].interruptError    = NO_IRQ)
 			return -EINVAL;
-		}
 	}
 
 	priv->gfargrp[priv->num_grps].grp_id = priv->num_grps;
Signature · 1 line
1.7.2.2
maintainer
#1 lore raw

From: Nicolas Kaiser <[email protected]>
Date: Mon, 15 Nov 2010 21:59:42 +0100

Quoted 7 lines

irq_of_parse_and_map() has an unsigned return type. Testing for a negative error value doesn't work here.

---
I see that in numerous places the return value is tested for NO_IRQ. I hope it's the right thing to do here as well?

I think it is, applied, thank you.