Patchwork [U-Boot,15/56] board/tqc/tqm5200/cam5200_flash.c: Fix GCC 4.6 build warning

login
register
mail settings
Submitter Wolfgang Denk
Date Nov. 5, 2011, 1:55 a.m.
Message ID <1320458160-23136-16-git-send-email-wd@denx.de>
Download mbox | patch
Permalink /patch/123761/
State Accepted
Commit e012d97ad47211374e9dc08ec4c4e9e116d63288
Headers show

Comments

Wolfgang Denk - Nov. 5, 2011, 1:55 a.m.
Fix:
cam5200_flash.c: In function 'flash_erase_32':
cam5200_flash.c:282:24: warning: variable 'l_sect' set but not used
[-Wunused-but-set-variable]
cam5200_flash.c: In function 'flash_erase_16':
cam5200_flash.c:612:24: warning: variable 'l_sect' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
 board/tqc/tqm5200/cam5200_flash.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
Wolfgang Denk - Nov. 7, 2011, 9:11 p.m.
Dear Wolfgang Denk,

In message <1320458160-23136-16-git-send-email-wd@denx.de> you wrote:
> Fix:
> cam5200_flash.c: In function 'flash_erase_32':
> cam5200_flash.c:282:24: warning: variable 'l_sect' set but not used
> [-Wunused-but-set-variable]
> cam5200_flash.c: In function 'flash_erase_16':
> cam5200_flash.c:612:24: warning: variable 'l_sect' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> ---
>  board/tqc/tqm5200/cam5200_flash.c |   10 ++--------
>  1 files changed, 2 insertions(+), 8 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/board/tqc/tqm5200/cam5200_flash.c b/board/tqc/tqm5200/cam5200_flash.c
index 4c8922f..5329c2a 100644
--- a/board/tqc/tqm5200/cam5200_flash.c
+++ b/board/tqc/tqm5200/cam5200_flash.c
@@ -279,7 +279,7 @@  int flash_erase(flash_info_t * info, int s_first, int s_last)
 {
 	volatile CONFIG_SYS_FLASH_WORD_SIZE *addr = (CONFIG_SYS_FLASH_WORD_SIZE *) (info->start[0]);
 	volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2;
-	int flag, prot, sect, l_sect;
+	int flag, prot, sect;
 
 	if ((s_first < 0) || (s_first > s_last)) {
 		if (info->flash_id == FLASH_UNKNOWN)
@@ -305,8 +305,6 @@  int flash_erase(flash_info_t * info, int s_first, int s_last)
 
 	printf("\n");
 
-	l_sect = -1;
-
 	/* Disable interrupts which might cause a timeout here */
 	flag = disable_interrupts();
 
@@ -322,7 +320,6 @@  int flash_erase(flash_info_t * info, int s_first, int s_last)
 			addr[CONFIG_SYS_FLASH_ADDR1] = (CONFIG_SYS_FLASH_WORD_SIZE) 0x00550055;
 			addr2[0] = (CONFIG_SYS_FLASH_WORD_SIZE) 0x00300030;	/* sector erase */
 
-			l_sect = sect;
 			/*
 			 * Wait for each sector to complete, it's more
 			 * reliable.  According to AMD Spec, you must
@@ -609,7 +606,7 @@  static int flash_erase_16(flash_info_t * info, int s_first, int s_last)
 {
 	volatile CONFIG_SYS_FLASH_WORD_SIZE *addr = (CONFIG_SYS_FLASH_WORD_SIZE *) (info->start[0]);
 	volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2;
-	int flag, prot, sect, l_sect;
+	int flag, prot, sect;
 
 	if ((s_first < 0) || (s_first > s_last)) {
 		if (info->flash_id == FLASH_UNKNOWN)
@@ -635,8 +632,6 @@  static int flash_erase_16(flash_info_t * info, int s_first, int s_last)
 
 	printf("\n");
 
-	l_sect = -1;
-
 	/* Disable interrupts which might cause a timeout here */
 	flag = disable_interrupts();
 
@@ -652,7 +647,6 @@  static int flash_erase_16(flash_info_t * info, int s_first, int s_last)
 			addr[CONFIG_SYS_FLASH_ADDR1] = (CONFIG_SYS_FLASH_WORD_SIZE) 0x55005500;
 			addr2[0] = (CONFIG_SYS_FLASH_WORD_SIZE) 0x30003000;	/* sector erase */
 
-			l_sect = sect;
 			/*
 			 * Wait for each sector to complete, it's more
 			 * reliable.  According to AMD Spec, you must