Patchwork [U-Boot,14/56] board/esd/pf5200/pf5200.c: Fix GCC 4.6 build warning

login
register
mail settings
Submitter Wolfgang Denk
Date Nov. 5, 2011, 1:55 a.m.
Message ID <1320458160-23136-15-git-send-email-wd@denx.de>
Download mbox | patch
Permalink /patch/123756/
State Accepted
Commit 7df80ac92d6c0ae71cf95a3c67934ca5e4f7eb36
Headers show

Comments

Wolfgang Denk - Nov. 5, 2011, 1:55 a.m.
Fix:
pf5200.c: In function 'do_phypower':
pf5200.c:330:6: warning: variable 'status' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com>
---
 board/esd/pf5200/pf5200.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
Wolfgang Denk - Nov. 7, 2011, 9:11 p.m.
Dear Wolfgang Denk,

In message <1320458160-23136-15-git-send-email-wd@denx.de> you wrote:
> Fix:
> pf5200.c: In function 'do_phypower':
> pf5200.c:330:6: warning: variable 'status' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com>
> ---
>  board/esd/pf5200/pf5200.c |   10 ++++------
>  1 files changed, 4 insertions(+), 6 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/board/esd/pf5200/pf5200.c b/board/esd/pf5200/pf5200.c
index 83dbfcb..2e07ac1 100644
--- a/board/esd/pf5200/pf5200.c
+++ b/board/esd/pf5200/pf5200.c
@@ -327,13 +327,11 @@  int phypower(int flag)
 
 int do_phypower(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
-	int status;
+	if (argv[1][0] == '0')
+		(void)phypower(0);
+	else
+		(void)phypower(1);
 
-	if (argv[1][0] == '0') {
-		status = phypower(0);
-	} else {
-		status = phypower(1);
-	}
 	return (0);
 }