Skip to contentSkip to conversation

common: tsi148 - fix gcc 4.6 compiler warning

PATCH New Kim Phillips 2 participants 2 messages Nov 16, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common: tsi148 - fix gcc 4.6 compiler warning

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]

---
 common/cmd_tsi148.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
common/cmd_tsi148.c +2 -5
index 6dc9dab..7f48ea2 100644
@@ -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;
 }
Signature · 1 line
1.7.7.3
#1 lore raw

PATCH 1/1 common: tsi148 - fix gcc 4.6 compiler warning

Dear Kim Phillips,

Quoted 8 lines · In message <[email protected]> you…

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]

---
 common/cmd_tsi148.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A committee is a life form with six or more legs and no brain.
                              -- Lazarus Long, "Time Enough For Love"