Patchwork [U-Boot,07/10] board/lubbock/flash.c: Fix GCC 4.6 warnings

login
register
mail settings
Submitter Anatolij Gustschin
Date Nov. 19, 2011, 11:12 p.m.
Message ID <1321744338-13207-8-git-send-email-agust@denx.de>
Download mbox | patch
Permalink /patch/126627/
State Accepted
Commit 90729c023898bab4fb5f7225678a6dc45dfc46c2
Headers show

Comments

Anatolij Gustschin - Nov. 19, 2011, 11:12 p.m.
Fix:
flash.c: In function 'flash_erase':
flash.c:223:6: warning: variable 'flag' set but not used [-Wunused-but-set-variable]
flash.c: In function 'write_data':
flash.c:392:6: warning: variable 'flag' set but not used [-Wunused-but-set-variable]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
 board/lubbock/flash.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
Heiko Schocher - Nov. 23, 2011, 7:22 a.m.
Hello Anatolij,

Anatolij Gustschin wrote:
> Fix:
> flash.c: In function 'flash_erase':
> flash.c:223:6: warning: variable 'flag' set but not used [-Wunused-but-set-variable]
> flash.c: In function 'write_data':
> flash.c:392:6: warning: variable 'flag' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
>  board/lubbock/flash.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)

Applied to u-boot-staging hs@denx.de

Thanks!

bye,
Heiko

Patch

diff --git a/board/lubbock/flash.c b/board/lubbock/flash.c
index e1e7807..bf8f0c9 100644
--- a/board/lubbock/flash.c
+++ b/board/lubbock/flash.c
@@ -220,7 +220,7 @@  static ulong flash_get_size (FPW *addr, flash_info_t *info)
 
 int flash_erase (flash_info_t *info, int s_first, int s_last)
 {
-	int flag, prot, sect;
+	int prot, sect;
 	ulong type, start;
 	int rcode = 0;
 
@@ -255,7 +255,7 @@  int flash_erase (flash_info_t *info, int s_first, int s_last)
 	}
 
 	/* Disable interrupts which might cause a timeout here */
-	flag = disable_interrupts ();
+	disable_interrupts();
 
 	/* Start erase on unprotected sectors */
 	for (sect = s_first; sect <= s_last; sect++) {
@@ -389,7 +389,6 @@  static int write_data (flash_info_t *info, ulong dest, FPW data)
 {
 	FPWV *addr = (FPWV *) dest;
 	ulong status;
-	int flag;
 	ulong start;
 
 	/* Check if Flash is (sufficiently) erased */
@@ -398,7 +397,7 @@  static int write_data (flash_info_t *info, ulong dest, FPW data)
 		return (2);
 	}
 	/* Disable interrupts which might cause a timeout here */
-	flag = disable_interrupts ();
+	disable_interrupts();
 
 	*addr = (FPW) 0x00400040;	/* write setup */
 	*addr = data;