Patchwork [U-Boot,03/22] board/mousse/flash.c: Fix GCC 4.6 buil warnings

login
register
mail settings
Submitter Wolfgang Denk
Date Nov. 5, 2011, 3:13 p.m.
Message ID <1320505999-9770-4-git-send-email-wd@denx.de>
Download mbox | patch
Permalink /patch/123862/
State Accepted
Commit a3cfb39b72d833fc60f361415dd1e26af3f8365c
Headers show

Comments

Wolfgang Denk - Nov. 5, 2011, 3:13 p.m.
Fix:
flash.c: In function 'flash_erase':
flash.c:780:18: warning: variable 'l_sect' set but not used
[-Wunused-but-set-variable]
flash.c:779:11: warning: variable 'addr' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
 board/mousse/flash.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
Wolfgang Denk - Nov. 7, 2011, 9:18 p.m.
Dear Wolfgang Denk,

In message <1320505999-9770-4-git-send-email-wd@denx.de> you wrote:
> Fix:
> flash.c: In function 'flash_erase':
> flash.c:780:18: warning: variable 'l_sect' set but not used
> [-Wunused-but-set-variable]
> flash.c:779:11: warning: variable 'addr' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> ---
>  board/mousse/flash.c |    8 +-------
>  1 files changed, 1 insertions(+), 7 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/board/mousse/flash.c b/board/mousse/flash.c
index d729f33..cc40535 100644
--- a/board/mousse/flash.c
+++ b/board/mousse/flash.c
@@ -776,8 +776,7 @@  void flash_print_info (flash_info_t * info)
  */
 int flash_erase (flash_info_t * info, int s_first, int s_last)
 {
-	vu_long *addr = (vu_long *) (info->start[0]);
-	int prot, sect, l_sect;
+	int prot, sect;
 	flash_dev_t *dev = NULL;
 
 	if ((s_first < 0) || (s_first > s_last)) {
@@ -803,17 +802,12 @@  int flash_erase (flash_info_t * info, int s_first, int s_last)
 		printf ("\n");
 	}
 
-	l_sect = -1;
-
 	/* Start erase on unprotected sectors */
 	dev = getFlashDevFromInfo (info);
 	if (dev) {
 		printf ("Erase FLASH[%s] -%d sectors:", dev->name, dev->sectors);
 		for (sect = s_first; sect <= s_last; sect++) {
 			if (info->protect[sect] == 0) {	/* not protected */
-				addr = (vu_long *) (dev->base);
-				/*   printf("erase_sector: sector=%d, addr=0x%x\n",
-				   sect, addr); */
 				printf (".");
 				if (ERROR == flashEraseSector (dev, sect)) {
 					printf ("ERROR: could not erase sector %d on FLASH[%s]\n", sect, dev->name);