All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] netxen: do_rom_fast_write error handling
@ 2007-02-26 22:51 Stephen Hemminger
  2007-02-27  6:41 ` Amit Kale
  2007-02-27  9:39 ` Jeff Garzik
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Hemminger @ 2007-02-26 22:51 UTC (permalink / raw)
  To: Amit S. Kale, Jeff Garzik; +Cc: netdev

Compiler warning spots real error!

The function do_rom_fast_read called in do_rom_fast_write can fail
and leave data1 unset. This causes a compile warning.  
The correct thing is to propagate the error out.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

---
 drivers/net/netxen/netxen_nic_init.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- pktgen.orig/drivers/net/netxen/netxen_nic_init.c	2007-02-26 14:45:46.000000000 -0800
+++ pktgen/drivers/net/netxen/netxen_nic_init.c	2007-02-26 14:46:37.000000000 -0800
@@ -499,7 +499,10 @@
 		while(1) {
 			int data1;
 
-			do_rom_fast_read(adapter, addridx, &data1);
+			ret = do_rom_fast_read(adapter, addridx, &data1);
+			if (ret < 0)
+				return ret;
+
 			if (data1 == data)
 				break;
 

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

* Re: [PATCH] netxen: do_rom_fast_write error handling
  2007-02-26 22:51 [PATCH] netxen: do_rom_fast_write error handling Stephen Hemminger
@ 2007-02-27  6:41 ` Amit Kale
  2007-02-27  9:39 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Amit Kale @ 2007-02-27  6:41 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Jeff Garzik, netdev

Ah.. missed that.
Thanks.
-Amit

On Tuesday 27 February 2007 04:21, Stephen Hemminger wrote:
> Compiler warning spots real error!
>
> The function do_rom_fast_read called in do_rom_fast_write can fail
> and leave data1 unset. This causes a compile warning.
> The correct thing is to propagate the error out.
>
> Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
>
> ---
>  drivers/net/netxen/netxen_nic_init.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> --- pktgen.orig/drivers/net/netxen/netxen_nic_init.c	2007-02-26
> 14:45:46.000000000 -0800 +++
> pktgen/drivers/net/netxen/netxen_nic_init.c	2007-02-26 14:46:37.000000000
> -0800 @@ -499,7 +499,10 @@
>  		while(1) {
>  			int data1;
>
> -			do_rom_fast_read(adapter, addridx, &data1);
> +			ret = do_rom_fast_read(adapter, addridx, &data1);
> +			if (ret < 0)
> +				return ret;
> +
>  			if (data1 == data)
>  				break;

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

* Re: [PATCH] netxen: do_rom_fast_write error handling
  2007-02-26 22:51 [PATCH] netxen: do_rom_fast_write error handling Stephen Hemminger
  2007-02-27  6:41 ` Amit Kale
@ 2007-02-27  9:39 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2007-02-27  9:39 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Amit S. Kale, netdev

Stephen Hemminger wrote:
> Compiler warning spots real error!
> 
> The function do_rom_fast_read called in do_rom_fast_write can fail
> and leave data1 unset. This causes a compile warning.  
> The correct thing is to propagate the error out.
> 
> Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
> 
> ---
>  drivers/net/netxen/netxen_nic_init.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

applied



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

end of thread, other threads:[~2007-02-27  9:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-26 22:51 [PATCH] netxen: do_rom_fast_write error handling Stephen Hemminger
2007-02-27  6:41 ` Amit Kale
2007-02-27  9:39 ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.