Thread (19 messages) 19 messages, 6 authors, 2013-02-12

RE: [net-next 04/10] igb: Fix for sparse warning in igb_get_i2c_client

flat view

From: Wyborny, Carolyn <hidden>
Date: 2013-02-11 17:27:54

-----Original Message-----
From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
On Behalf Of Ben Hutchings
Sent: Monday, February 11, 2013 9:06 AM
To: Kirsher, Jeffrey T; Wyborny, Carolyn
Cc: davem@davemloft.net; netdev@vger.kernel.org; gospo@redhat.com;
sassmann@redhat.com
Subject: Re: [net-next 04/10] igb: Fix for sparse warning in igb_get_i2c_client

On Fri, 2013-02-08 at 02:39 -0800, Jeff Kirsher wrote:
quoted
From: Carolyn Wyborny <redacted>

This patch changes definition of i2c_client in igb_get_i2c_client to
static to prevent sparse warning.
So, in order to fix the warning:

drivers/net/ethernet/intel/igb/igb_main.c:7611:19: warning: symbol
'igb_get_i2c_client' was not declared. Should it be static?

you don't touch the function declaration, but instead make a local variable
static.  This doesn't fix the warning, but does introduce a race condition...

Ben.
quoted
Reported-by: Fengguang Wu <redacted>
Signed-off-by: Carolyn Wyborny <redacted>
Tested-by: Aaron Brown <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c
b/drivers/net/ethernet/intel/igb/igb_main.c
index c19a35c..ebf8384 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -7732,7 +7732,7 @@ igb_get_i2c_client(struct igb_adapter *adapter,
u8 dev_addr)  {
 	ulong flags;
 	struct igb_i2c_client_list *client_list;
-	struct i2c_client *client = NULL;
+	static struct i2c_client *client;
 	struct i2c_board_info client_info = {
 		I2C_BOARD_INFO("igb", 0x00),
 	};
--
Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's
the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a
message to majordomo@vger.kernel.org More majordomo info at
http://vger.kernel.org/majordomo-info.html
Yes, my mistake in taking a quick suggestion without enough evaluation.  I'm in the process of completely redoing this to not allocate clients on the fly which will fully fix this problem and the initial one.

Thanks,

Carolyn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help