Patchwork [26/43] drivers/net/sfc: fix sparse warning: symbol shadows an earlier one

login
register
mail settings
Submitter Hannes Eder
Date Feb. 14, 2009, 9:41 p.m.
Message ID <20090214213932.24377.94262.stgit@vmbox.hanneseder.net>
Download mbox | patch
Permalink /patch/23172/
State Accepted
Delegated to: David Miller
Headers show

Comments

Hannes Eder - Feb. 14, 2009, 9:41 p.m.
Impact: Move variable declaration as close to their usage as possible.

Fix this sparse warning:
  drivers/net/sfc/tenxpress.c:589:22: warning: symbol 'link_ok' shadows an earlier one
  drivers/net/sfc/tenxpress.c:575:30: originally declared here

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
---
 drivers/net/sfc/tenxpress.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)


--
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
Ben Hutchings - Feb. 16, 2009, 12:38 a.m.
Hannes Eder wrote:
> Impact: Move variable declaration as close to their usage as possible.
> 
> Fix this sparse warning:
>   drivers/net/sfc/tenxpress.c:589:22: warning: symbol 'link_ok' shadows an earlier one
>   drivers/net/sfc/tenxpress.c:575:30: originally declared here
> 
> Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Acked-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
>  drivers/net/sfc/tenxpress.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/sfc/tenxpress.c b/drivers/net/sfc/tenxpress.c
> index ac9eeab..5b0f451 100644
> --- a/drivers/net/sfc/tenxpress.c
> +++ b/drivers/net/sfc/tenxpress.c
> @@ -572,15 +572,14 @@ static void tenxpress_phy_reconfigure(struct efx_nic *efx)
>  static void tenxpress_phy_poll(struct efx_nic *efx)
>  {
>  	struct tenxpress_phy_data *phy_data = efx->phy_data;
> -	bool change = false, link_ok;
> -	unsigned link_fc;
> +	bool change = false;
>  
>  	if (efx->phy_type == PHY_TYPE_SFX7101) {
> -		link_ok = sfx7101_link_ok(efx);
> +		bool link_ok = sfx7101_link_ok(efx);
>  		if (link_ok != efx->link_up) {
>  			change = true;
>  		} else {
> -			link_fc = mdio_clause45_get_pause(efx);
> +			unsigned int link_fc = mdio_clause45_get_pause(efx);
>  			if (link_fc != efx->link_fc)
>  				change = true;
>  		}
> 
> --
> 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
David Miller - Feb. 18, 2009, 1:39 a.m.
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Mon, 16 Feb 2009 00:38:20 +0000

> Hannes Eder wrote:
> > Impact: Move variable declaration as close to their usage as possible.
> > 
> > Fix this sparse warning:
> >   drivers/net/sfc/tenxpress.c:589:22: warning: symbol 'link_ok' shadows an earlier one
> >   drivers/net/sfc/tenxpress.c:575:30: originally declared here
> > 
> > Signed-off-by: Hannes Eder <hannes@hanneseder.net>
> Acked-by: Ben Hutchings <bhutchings@solarflare.com>

Applied.
--
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

Patch

diff --git a/drivers/net/sfc/tenxpress.c b/drivers/net/sfc/tenxpress.c
index ac9eeab..5b0f451 100644
--- a/drivers/net/sfc/tenxpress.c
+++ b/drivers/net/sfc/tenxpress.c
@@ -572,15 +572,14 @@  static void tenxpress_phy_reconfigure(struct efx_nic *efx)
 static void tenxpress_phy_poll(struct efx_nic *efx)
 {
 	struct tenxpress_phy_data *phy_data = efx->phy_data;
-	bool change = false, link_ok;
-	unsigned link_fc;
+	bool change = false;
 
 	if (efx->phy_type == PHY_TYPE_SFX7101) {
-		link_ok = sfx7101_link_ok(efx);
+		bool link_ok = sfx7101_link_ok(efx);
 		if (link_ok != efx->link_up) {
 			change = true;
 		} else {
-			link_fc = mdio_clause45_get_pause(efx);
+			unsigned int link_fc = mdio_clause45_get_pause(efx);
 			if (link_fc != efx->link_fc)
 				change = true;
 		}