From 18b89072f6194411517597678d680255ee94a7b2 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Sat, 3 Dec 2011 06:46:08 +0000 Subject: drivers/mtd/nand/nand_spl_simple.c: Fix GCC 4.6 warnings Fix warnings for both cases: definded CONFIG_SYS_NAND_HW_ECC_OOBFIRST: nand_spl_simple.c: In function 'nand_read_page': nand_spl_simple.c:156:6: warning: variable 'stat' set but not used [-Wunused-but-set-variable] not definded CONFIG_SYS_NAND_HW_ECC_OOBFIRST: nand_spl_simple.c: In function 'nand_read_page': nand_spl_simple.c:196:6: warning: variable 'stat' set but not used [-Wunused-but-set-variable] Signed-off-by: Anatolij Gustschin Cc: Heiko Schocher Cc: Scott Wood Acked-by: Heiko Schocher Acked-by: Marek Vasut Signed-off-by: Scott Wood --- drivers/mtd/nand/nand_spl_simple.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/nand_spl_simple.c b/drivers/mtd/nand/nand_spl_simple.c index ed821f2..7eb08a3 100644 --- a/drivers/mtd/nand/nand_spl_simple.c +++ b/drivers/mtd/nand/nand_spl_simple.c @@ -153,7 +153,6 @@ static int nand_read_page(int block, int page, uchar *dst) int eccbytes = CONFIG_SYS_NAND_ECCBYTES; int eccsteps = CONFIG_SYS_NAND_ECCSTEPS; uint8_t *p = dst; - int stat; /* * No malloc available for now, just use some temporary locations @@ -176,7 +175,7 @@ static int nand_read_page(int block, int page, uchar *dst) this->ecc.hwctl(&mtd, NAND_ECC_READ); this->read_buf(&mtd, p, eccsize); this->ecc.calculate(&mtd, p, &ecc_calc[i]); - 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; @@ -193,7 +192,6 @@ static int nand_read_page(int block, int page, void *dst) int eccbytes = CONFIG_SYS_NAND_ECCBYTES; int eccsteps = CONFIG_SYS_NAND_ECCSTEPS; uint8_t *p = dst; - int stat; nand_command(block, page, 0, NAND_CMD_READ0); @@ -224,7 +222,7 @@ static int nand_read_page(int block, int page, void *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; -- cgit v1.1 From b7fde587bfc31e45fe17e49ddd83d57cf1720b67 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Sat, 3 Dec 2011 06:46:09 +0000 Subject: drivers/mtd/nand/nand_spl_load.c: Fix GCC 4.6 warning Fix: nand_spl_load.c: In function 'nand_boot': nand_spl_load.c:31:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] Signed-off-by: Anatolij Gustschin Cc: Heiko Schocher Cc: Scott Wood Acked-by: Heiko Schocher Acked-by: Marek Vasut Signed-off-by: Scott Wood --- drivers/mtd/nand/nand_spl_load.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/nand/nand_spl_load.c b/drivers/mtd/nand/nand_spl_load.c index ae8d5ac..215459a 100644 --- a/drivers/mtd/nand/nand_spl_load.c +++ b/drivers/mtd/nand/nand_spl_load.c @@ -28,23 +28,22 @@ */ void nand_boot(void) { - int ret; __attribute__((noreturn)) void (*uboot)(void); /* * Load U-Boot image from NAND into RAM */ - ret = nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS, + nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS, CONFIG_SYS_NAND_U_BOOT_SIZE, - (void *)CONFIG_SYS_NAND_U_BOOT_DST); + (void *)CONFIG_SYS_NAND_U_BOOT_DST); #ifdef CONFIG_NAND_ENV_DST - ret = nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, - (void *)CONFIG_NAND_ENV_DST); + nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, + (void *)CONFIG_NAND_ENV_DST); #ifdef CONFIG_ENV_OFFSET_REDUND - ret = nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, CONFIG_ENV_SIZE, - (void *)CONFIG_NAND_ENV_DST + CONFIG_ENV_SIZE); + nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, CONFIG_ENV_SIZE, + (void *)CONFIG_NAND_ENV_DST + CONFIG_ENV_SIZE); #endif #endif -- cgit v1.1 From 40a0682d4ae69bdd8b6aa10b6dcb57a489ae875c Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Wed, 7 Dec 2011 11:58:56 +0000 Subject: nand_spl/nand_boot.c: Fix build warning Fix: nand_boot.c: In function 'nand_read_page': nand_boot.c:150:6: warning: variable 'stat' set but not used [-Wunused-but-set-variable] Signed-off-by: Anatolij Gustschin Signed-off-by: Scott Wood --- nand_spl/nand_boot.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nand_spl/nand_boot.c b/nand_spl/nand_boot.c index bee1029..2326962 100644 --- a/nand_spl/nand_boot.c +++ b/nand_spl/nand_boot.c @@ -147,7 +147,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; /* * No malloc available for now, just use some temporary locations @@ -170,7 +169,7 @@ static int nand_read_page(struct mtd_info *mtd, int block, int page, uchar *dst) this->ecc.hwctl(mtd, NAND_ECC_READ); this->read_buf(mtd, p, eccsize); this->ecc.calculate(mtd, p, &ecc_calc[i]); - 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; -- cgit v1.1