Patchwork [U-Boot,06/12] board/cm4008/flash.c: Fix GCC 4.6 warnings

login
register
mail settings
Submitter Anatolij Gustschin
Date Nov. 15, 2011, 11:20 p.m.
Message ID <1321399263-13826-7-git-send-email-agust@denx.de>
Download mbox | patch
Permalink /patch/125887/
State Accepted
Commit 33ad5ef059a82a159de39efdb42c4fef88c542fc
Headers show

Comments

Anatolij Gustschin - Nov. 15, 2011, 11:20 p.m.
Fix:
flash.c: In function 'flash_erase':
flash.c:209:6: warning: variable 'flag' set but not used
[-Wunused-but-set-variable]
flash.c: In function 'write_data':
flash.c:373:6: warning: variable 'flag' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
 board/cm4008/flash.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
Wolfgang Denk - Nov. 16, 2011, 8:35 p.m.
Dear Anatolij Gustschin,

In message <1321399263-13826-7-git-send-email-agust@denx.de> you wrote:
> Fix:
> flash.c: In function 'flash_erase':
> flash.c:209:6: warning: variable 'flag' set but not used
> [-Wunused-but-set-variable]
> flash.c: In function 'write_data':
> flash.c:373:6: warning: variable 'flag' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
>  board/cm4008/flash.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/board/cm4008/flash.c b/board/cm4008/flash.c
index 2e1356f..5522bf0 100644
--- a/board/cm4008/flash.c
+++ b/board/cm4008/flash.c
@@ -206,7 +206,7 @@  static ulong flash_get_size (unsigned char * 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;
 	int rcode = 0;
 	ulong start;
@@ -240,7 +240,7 @@  int flash_erase (flash_info_t * info, int s_first, int s_last)
 		printf ("\n");
 
 	/* 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++) {
@@ -370,7 +370,6 @@  static int write_data (flash_info_t * info, ulong dest, unsigned char data)
 {
 	volatile unsigned char *addr = (volatile unsigned char *) dest;
 	ulong status;
-	int flag;
 	ulong start;
 
 	/* Check if Flash is (sufficiently) erased */
@@ -380,7 +379,7 @@  static int write_data (flash_info_t * info, ulong dest, unsigned char data)
 		return (2);
 	}
 	/* Disable interrupts which might cause a timeout here */
-	flag = disable_interrupts ();
+	disable_interrupts();
 
 	*addr = 0x40;	/* write setup */
 	*addr = data;