* [PATCH] gianfar: fix signedness issue
@ 2010-11-15 20:59 Nicolas Kaiser
2010-11-17 20:40 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Kaiser @ 2010-11-15 20:59 UTC (permalink / raw)
To: Kumar Gala; +Cc: netdev, kernel-janitors, linux-kernel
irq_of_parse_and_map() has an unsigned return type.
Testing for a negative error value doesn't work here.
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
---
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(-)
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 49e4ce1..d1bec62 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -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;
--
1.7.2.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gianfar: fix signedness issue
2010-11-15 20:59 [PATCH] gianfar: fix signedness issue Nicolas Kaiser
@ 2010-11-17 20:40 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-11-17 20:40 UTC (permalink / raw)
To: nikai; +Cc: galak, netdev, kernel-janitors, linux-kernel
From: Nicolas Kaiser <nikai@nikai.net>
Date: Mon, 15 Nov 2010 21:59:42 +0100
> irq_of_parse_and_map() has an unsigned return type.
> Testing for a negative error value doesn't work here.
>
> Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
> ---
> 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-17 20:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-15 20:59 [PATCH] gianfar: fix signedness issue Nicolas Kaiser
2010-11-17 20:40 ` David Miller
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).