Patchwork [U-Boot] common: tsi148 - fix gcc 4.6 compiler warning

login
register
mail settings
Submitter Kim Phillips
Date Nov. 16, 2011, 9:02 a.m.
Message ID <1321434143-3410-1-git-send-email-kim.phillips@freescale.com>
Download mbox | patch
Permalink /patch/125962/
State Accepted
Commit e1a37f8599d2ffbee37f23ee1b8760faf2e1f026
Headers show

Comments

Kim Phillips - Nov. 16, 2011, 9:02 a.m.
Configuring for vme8349 board...
cmd_tsi148.c: In function 'tsi148_init':
cmd_tsi148.c:56:17: warning: variable 'lastError' set but not used [-Wunused-but-set-variable]

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
---
 common/cmd_tsi148.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
Wolfgang Denk - Nov. 16, 2011, 8:42 p.m.
Dear Kim Phillips,

In message <1321434143-3410-1-git-send-email-kim.phillips@freescale.com> you wrote:
> Configuring for vme8349 board...
> cmd_tsi148.c: In function 'tsi148_init':
> cmd_tsi148.c:56:17: warning: variable 'lastError' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> ---
>  common/cmd_tsi148.c |    7 ++-----
>  1 files changed, 2 insertions(+), 5 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/common/cmd_tsi148.c b/common/cmd_tsi148.c
index 6dc9dab..7f48ea2 100644
--- a/common/cmd_tsi148.c
+++ b/common/cmd_tsi148.c
@@ -53,7 +53,7 @@  static TSI148_DEV *dev;
 
 int tsi148_init(void)
 {
-	int j, result, lastError = 0;
+	int j, result;
 	pci_dev_t busdevfn;
 	unsigned int val;
 
@@ -69,8 +69,7 @@  int tsi148_init(void)
 	dev = malloc(sizeof(*dev));
 	if (NULL == dev) {
 		puts("Tsi148: No memory!\n");
-		result = -1;
-		goto break_20;
+		return -1;
 	}
 
 	memset(dev, 0, sizeof(*dev));
@@ -139,8 +138,6 @@  int tsi148_init(void)
  break_30:
 	free(dev);
 	dev = NULL;
- break_20:
-	lastError = result;
 
 	return result;
 }