Patchwork [U-Boot,05/13] board/evb64260/eth.c: Fix GCC 4.6 build warning

login
register
mail settings
Submitter Wolfgang Denk
Date Nov. 9, 2011, 7:28 p.m.
Message ID <1320866946-28235-5-git-send-email-wd@denx.de>
Download mbox | patch
Permalink /patch/124669/
State Accepted
Commit b524b1c75d68f0dc39681d46982ac6fb1305d512
Headers show

Comments

Wolfgang Denk - Nov. 9, 2011, 7:28 p.m.
Fix:
eth.c: In function 'gt6426x_handle_SMI':
eth.c:130:15: warning: variable 'psr' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
 board/evb64260/eth.c |   37 +++++++++++++++++++------------------
 1 files changed, 19 insertions(+), 18 deletions(-)
Wolfgang Denk - Nov. 16, 2011, 8:04 p.m.
Dear Wolfgang Denk,

In message <1320866946-28235-5-git-send-email-wd@denx.de> you wrote:
> Fix:
> eth.c: In function 'gt6426x_handle_SMI':
> eth.c:130:15: warning: variable 'psr' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> ---
>  board/evb64260/eth.c |   37 +++++++++++++++++++------------------
>  1 files changed, 19 insertions(+), 18 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/board/evb64260/eth.c b/board/evb64260/eth.c
index 1492ffc..c02a9cd 100644
--- a/board/evb64260/eth.c
+++ b/board/evb64260/eth.c
@@ -127,31 +127,32 @@  static void gt6426x_handle_SMI(struct eth_dev_s *p, unsigned int icr)
 #endif
 
     if(icr&0x10000000) {
+#ifdef DEBUG
 	unsigned int psr;
+
 	psr=GTREGREAD(ETHERNET0_PORT_STATUS_REGISTER + p->reg_base);
-#ifdef DEBUG
 	printf("PHY state change:\n"
 	       "  GT:%s:%s:%s:%s\n",
-		psr&1?"100":" 10",
-		psr&8?" Link":"nLink",
-		psr&2?"FD":"HD",
-		psr&4?" FC":"nFC");
+		psr & 1 ? "100" : " 10",
+		psr & 8 ? " Link" : "nLink",
+		psr & 2 ? "FD" : "HD",
+		psr & 4 ? " FC" : "nFC");
 
 #ifdef CONFIG_INTEL_LXT97X /* non-standard mii reg (intel lxt972a) */
 	{
-	unsigned short mii_11;
-	mii_11=miiphy_read_ret(ether_port_phy_addr[p->dev],0x11);
-
-	printf(" mii:%s:%s:%s:%s %s:%s %s\n",
-		mii_11&(1<<14)?"100":" 10",
-		mii_11&(1<<10)?" Link":"nLink",
-		mii_11&(1<<9)?"FD":"HD",
-		mii_11&(1<<4)?" FC":"nFC",
-
-		mii_11&(1<<7)?"ANc":"ANnc",
-		mii_11&(1<<8)?"AN":"Manual",
-		""
-		);
+		unsigned short mii_11;
+		mii_11 = miiphy_read_ret(ether_port_phy_addr[p->dev], 0x11);
+
+		printf(" mii:%s:%s:%s:%s %s:%s %s\n",
+			mii_11 & (1 << 14) ? "100" : " 10",
+			mii_11 & (1 << 10) ? " Link" : "nLink",
+			mii_11 & (1 << 9) ? "FD" : "HD",
+			mii_11 & (1 << 4) ? " FC" : "nFC",
+
+			mii_11 & (1 << 7) ? "ANc" : "ANnc",
+			mii_11 & (1 << 8) ? "AN" : "Manual",
+			""
+			);
 	}
 #endif /* CONFIG_INTEL_LXT97X */
 #endif /* DEBUG */