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: Ben Hutchings <hidden>
Date: 2013-02-11 17:06:14

On Fri, 2013-02-08 at 02:39 -0800, Jeff Kirsher wrote:
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 hunk ↗ jump to hunk
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help