Skip to contentSkip to conversation

nand_boot.c: Fix GCC 4.6 build warnings

PATCH New Stefan Roese 2 participants 2 messages Nov 15, 2011 – Nov 16, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 12/19 nand_boot.c: Fix GCC 4.6 build warnings

Fix:
nand_boot.c: In function 'nand_read_page':
nand_boot.c:190:6: warning: variable 'stat' set but not used [-Wunused-but-set-variable] nand_boot.c: In function 'nand_boot':
nand_boot.c:271:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]

---
 nand_spl/nand_boot.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
nand_spl/nand_boot.c +3 -5
index 615ef25..bee1029 100644
@@ -187,7 +187,6 @@ static int nand_read_page(struct mtd_info *mtd, int block, int page, uchar *dst)
 	int eccbytes = CONFIG_SYS_NAND_ECCBYTES;
 	int eccsteps = CONFIG_SYS_NAND_ECCSTEPS;
 	uint8_t *p = dst;
-	int stat;
 
 	nand_command(mtd, block, page, 0, NAND_CMD_READ0);
 
@@ -217,7 +216,7 @@ static int nand_read_page(struct mtd_info *mtd, int block, int page, uchar *dst)
 		 * from correct_data(). We just hope that all possible errors
 		 * are corrected by this routine.
 		 */
-		stat = this->ecc.correct(mtd, p, &ecc_code[i], &ecc_calc[i]);
+		this->ecc.correct(mtd, p, &ecc_code[i], &ecc_calc[i]);
 	}
 
 	return 0;
@@ -268,7 +267,6 @@ void nand_boot(void)
 {
 	struct nand_chip nand_chip;
 	nand_info_t nand_info;
-	int ret;
 	__attribute__((noreturn)) void (*uboot)(void);
 
 	/*
@@ -287,8 +285,8 @@ void nand_boot(void)
 	/*
 	 * Load U-Boot image from NAND into RAM
 	 */
-	ret = nand_load(&nand_info, CONFIG_SYS_NAND_U_BOOT_OFFS, CONFIG_SYS_NAND_U_BOOT_SIZE,
-			(uchar *)CONFIG_SYS_NAND_U_BOOT_DST);
+	nand_load(&nand_info, CONFIG_SYS_NAND_U_BOOT_OFFS, CONFIG_SYS_NAND_U_BOOT_SIZE,
+		  (uchar *)CONFIG_SYS_NAND_U_BOOT_DST);
 
 #ifdef CONFIG_NAND_ENV_DST
 	nand_load(&nand_info, CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
Signature · 1 line
1.7.7.3
#1 lore raw

PATCH 12/19 nand_boot.c: Fix GCC 4.6 build warnings

Dear Stefan Roese,

Quoted 10 lines · In message <[email protected]> you wrote:

Fix:
nand_boot.c: In function 'nand_read_page':
nand_boot.c:190:6: warning: variable 'stat' set but not used [-Wunused-but-set-variable] nand_boot.c: In function 'nand_boot':
nand_boot.c:271:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]

---
 nand_spl/nand_boot.c |    8 +++-----
 1 files changed, 3 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
Cogito cogito ergo cogito sum - "I think that I  think,  therefore  I
think that I am."          - Ambrose Bierce, "The Devil's Dictionary"