All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	Carolyn Wyborny <carolyn.wyborny@intel.com>
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
Date: Mon, 11 Feb 2013 17:05:55 +0000	[thread overview]
Message-ID: <1360602355.2701.5.camel@bwh-desktop.uk.solarflarecom.com> (raw)
In-Reply-To: <1360319958-10497-5-git-send-email-jeffrey.t.kirsher@intel.com>

On Fri, 2013-02-08 at 02:39 -0800, Jeff Kirsher wrote:
> From: Carolyn Wyborny <carolyn.wyborny@intel.com>
> 
> 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.

> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
> Tested-by: Aaron Brown <aaron.f.brown@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
>  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.

  reply	other threads:[~2013-02-11 17:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-08 10:39 [net-next 00/10][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2013-02-08 10:39 ` [net-next 01/10] igb: Support using build_skb in the case that jumbo frames are disabled Jeff Kirsher
2013-02-08 10:39 ` [net-next 02/10] igb: Fix for improper exit in igb_get_i2c_client Jeff Kirsher
2013-02-08 10:39 ` [net-next 03/10] igb: Fix for improper allocation flag " Jeff Kirsher
2013-02-08 10:39 ` [net-next 04/10] igb: Fix for sparse warning " Jeff Kirsher
2013-02-11 17:05   ` Ben Hutchings [this message]
2013-02-11 17:27     ` Wyborny, Carolyn
2013-02-12 17:12     ` Wyborny, Carolyn
2013-02-12 17:17     ` Wyborny, Carolyn
2013-02-08 10:39 ` [net-next 05/10] igb: Update igb to use a path similar to ixgbe to determine when to stop Tx Jeff Kirsher
2013-02-08 12:26   ` Eric Dumazet
2013-02-08 17:11     ` Alexander Duyck
2013-02-08 19:18       ` David Miller
2013-02-08 20:19         ` Alexander Duyck
2013-02-08 10:39 ` [net-next 06/10] igb: Initialize PHY function pointers Jeff Kirsher
2013-02-08 10:39 ` [net-next 07/10] igb: Initialize NVM " Jeff Kirsher
2013-02-08 10:39 ` [net-next 08/10] igb: Intialize MAC " Jeff Kirsher
2013-02-08 10:39 ` [net-next 09/10] igb: Refractoring function pointers in igb_get_invariants function Jeff Kirsher
2013-02-08 10:39 ` [net-next 10/10] ixgbe: refactor initialization of feature flags Jeff Kirsher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360602355.2701.5.camel@bwh-desktop.uk.solarflarecom.com \
    --to=bhutchings@solarflare.com \
    --cc=carolyn.wyborny@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.