Patchwork [U-Boot,01/14] alpr board: Fix GCC 4.6 build warnings

login
register
mail settings
Submitter Wolfgang Denk
Date Nov. 30, 2011, 8:17 a.m.
Message ID <1322641077-829-2-git-send-email-wd@denx.de>
Download mbox | patch
Permalink /patch/128452/
State Accepted
Commit bba8f3929e1ae3c09274b8dcdf0ad7b099494f71
Headers show

Comments

Wolfgang Denk - Nov. 30, 2011, 8:17 a.m.
Fix:
fpga.c: In function 'fpga_pre_fn':
fpga.c:88:16: warning: variable 'reg' set but not used
[-Wunused-but-set-variable]
nand.c: In function 'alpr_nand_dev_ready':
nand.c:125:18: warning: variable 'val' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Stefan Roese <sr@denx.de>
---
total: 0 errors, 0 warnings, 22 lines checked
NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX MULTISTATEMENT_MACRO_USE_DO_WHILE

 board/prodrive/alpr/fpga.c |    3 ---
 board/prodrive/alpr/nand.c |    4 +---
 2 files changed, 1 insertions(+), 6 deletions(-)
Stefan Roese - Dec. 1, 2011, 8:55 a.m.
On Wednesday 30 November 2011 09:17:44 Wolfgang Denk wrote:
> Fix:
> fpga.c: In function 'fpga_pre_fn':
> fpga.c:88:16: warning: variable 'reg' set but not used
> [-Wunused-but-set-variable]
> nand.c: In function 'alpr_nand_dev_ready':
> nand.c:125:18: warning: variable 'val' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Stefan Roese <sr@denx.de>

Thanks.

Acked-by: Stefan Roese <sr@denx.de>

Best regards,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office@denx.de
Wolfgang Denk - Dec. 1, 2011, 11:09 p.m.
Dear Wolfgang Denk,

In message <1322641077-829-2-git-send-email-wd@denx.de> you wrote:
> Fix:
> fpga.c: In function 'fpga_pre_fn':
> fpga.c:88:16: warning: variable 'reg' set but not used
> [-Wunused-but-set-variable]
> nand.c: In function 'alpr_nand_dev_ready':
> nand.c:125:18: warning: variable 'val' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Stefan Roese <sr@denx.de>
> ---
> total: 0 errors, 0 warnings, 22 lines checked
> NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX MULTISTATEMENT_MACRO_USE_DO_WHILE
> 
>  board/prodrive/alpr/fpga.c |    3 ---
>  board/prodrive/alpr/nand.c |    4 +---
>  2 files changed, 1 insertions(+), 6 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/board/prodrive/alpr/fpga.c b/board/prodrive/alpr/fpga.c
index e7686ad..1cce798 100644
--- a/board/prodrive/alpr/fpga.c
+++ b/board/prodrive/alpr/fpga.c
@@ -85,9 +85,6 @@  static unsigned long regval;
 /* PROGRAM_SEL_DPR	= LOW */
 int fpga_pre_fn(int cookie)
 {
-	unsigned long	reg;
-
-	reg = in32(GPIO0_IR);
 	/* Enable the FPGA Chain */
 	SET_GPIO_REG_1(GPIO0_TCR, CONFIG_SYS_GPIO_PROG_EN);
 	SET_GPIO_REG_0(GPIO0_ODR, CONFIG_SYS_GPIO_PROG_EN);
diff --git a/board/prodrive/alpr/nand.c b/board/prodrive/alpr/nand.c
index b18c96b..d35cfed 100644
--- a/board/prodrive/alpr/nand.c
+++ b/board/prodrive/alpr/nand.c
@@ -122,12 +122,10 @@  static int alpr_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len
 
 static int alpr_nand_dev_ready(struct mtd_info *mtd)
 {
-	volatile u_char val;
-
 	/*
 	 * Blocking read to wait for NAND to be ready
 	 */
-	val = readb(&(alpr_ndfc->addr_wait));
+	(void)readb(&(alpr_ndfc->addr_wait));
 
 	/*
 	 * Return always true