Patchwork [U-Boot,13/14] board/sbc405/strataflash.c: Fix GCC 4.6 build warning

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

Comments

Wolfgang Denk - Nov. 30, 2011, 8:17 a.m.
Fix:
strataflash.c: In function 'flash_write_cfiword':
strataflash.c:673:11: warning: variable 'ctladdr' set but not used
[-Wunused-but-set-variable]

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

 board/sbc405/strataflash.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
Marek Vasut - Dec. 1, 2011, 10:14 p.m.
> Fix:
> strataflash.c: In function 'flash_write_cfiword':
> strataflash.c:673:11: warning: variable 'ctladdr' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> ---
> total: 0 errors, 0 warnings, 14 lines checked
> NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX
> MULTISTATEMENT_MACRO_USE_DO_WHILE
> 
>  board/sbc405/strataflash.c |    3 ---
>  1 files changed, 0 insertions(+), 3 deletions(-)
> 
> diff --git a/board/sbc405/strataflash.c b/board/sbc405/strataflash.c
> index e5863d6..b0d3c6c 100644
> --- a/board/sbc405/strataflash.c
> +++ b/board/sbc405/strataflash.c
> @@ -670,14 +670,11 @@ static ulong flash_get_size (ulong base, int banknum)
>  static int flash_write_cfiword (flash_info_t *info, ulong dest, cfiword_t
> cword) {
> 
> -	cfiptr_t ctladdr;
>  	cfiptr_t cptr;
>  	int flag;
> 
> -	ctladdr.cp = flash_make_addr(info, 0, 0);
>  	cptr.cp = (uchar *)dest;
> 
> -
>  	/* Check if Flash is (sufficiently) erased */
>  	switch(info->portwidth) {
>  	case FLASH_CFI_8BIT:

The logic looks OK

Acked-by: Marek Vasut <marek.vasut@gmail.com>
Wolfgang Denk - Dec. 1, 2011, 11:17 p.m.
Dear Wolfgang Denk,

In message <1322641077-829-14-git-send-email-wd@denx.de> you wrote:
> Fix:
> strataflash.c: In function 'flash_write_cfiword':
> strataflash.c:673:11: warning: variable 'ctladdr' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> ---
> total: 0 errors, 0 warnings, 14 lines checked
> NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX MULTISTATEMENT_MACRO_USE_DO_WHILE
> 
>  board/sbc405/strataflash.c |    3 ---
>  1 files changed, 0 insertions(+), 3 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/board/sbc405/strataflash.c b/board/sbc405/strataflash.c
index e5863d6..b0d3c6c 100644
--- a/board/sbc405/strataflash.c
+++ b/board/sbc405/strataflash.c
@@ -670,14 +670,11 @@  static ulong flash_get_size (ulong base, int banknum)
 static int flash_write_cfiword (flash_info_t *info, ulong dest, cfiword_t cword)
 {
 
-	cfiptr_t ctladdr;
 	cfiptr_t cptr;
 	int flag;
 
-	ctladdr.cp = flash_make_addr(info, 0, 0);
 	cptr.cp = (uchar *)dest;
 
-
 	/* Check if Flash is (sufficiently) erased */
 	switch(info->portwidth) {
 	case FLASH_CFI_8BIT: