diff mbox

[U-Boot,43/56] board/rbc823/flash.c: Fix flash initalization

Message ID 1320458160-23136-44-git-send-email-wd@denx.de
State Accepted
Commit e0ead84895dc439c42f83fa18ebbe88865e8383b
Headers show

Commit Message

Wolfgang Denk Nov. 5, 2011, 1:55 a.m. UTC
The RBC823 has only one NOR flash bank.  Remove all code trying to
deal with a second bank.  This also fixes a number of GCC 4.6 build
warnings:
flash.c: In function 'flash_init':
flash.c:62:12: warning: array subscript is above array bounds
[-Warray-bounds]
flash.c:63:12: warning: array subscript is above array bounds
[-Warray-bounds]
flash.c:66:12: warning: array subscript is above array bounds
[-Warray-bounds]

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
 board/rbc823/flash.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

Comments

Wolfgang Denk Nov. 7, 2011, 9:15 p.m. UTC | #1
Dear Wolfgang Denk,

In message <1320458160-23136-44-git-send-email-wd@denx.de> you wrote:
> The RBC823 has only one NOR flash bank.  Remove all code trying to
> deal with a second bank.  This also fixes a number of GCC 4.6 build
> warnings:
> flash.c: In function 'flash_init':
> flash.c:62:12: warning: array subscript is above array bounds
> [-Warray-bounds]
> flash.c:63:12: warning: array subscript is above array bounds
> [-Warray-bounds]
> flash.c:66:12: warning: array subscript is above array bounds
> [-Warray-bounds]
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> ---
>  board/rbc823/flash.c |   12 +++---------
>  1 files changed, 3 insertions(+), 9 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk
diff mbox

Patch

diff --git a/board/rbc823/flash.c b/board/rbc823/flash.c
index 149a1b9..6be2bc9 100644
--- a/board/rbc823/flash.c
+++ b/board/rbc823/flash.c
@@ -35,7 +35,7 @@  static void flash_get_offsets(ulong base, flash_info_t *info);
 
 unsigned long flash_init(void)
 {
-	unsigned long size_b0, size_b1;
+	unsigned long size_b0;
 	int i;
 
 	/* Init: no FLASHes known */
@@ -57,15 +57,9 @@  unsigned long flash_init(void)
 		      &flash_info[0]);
 #endif
 
-	size_b1 = 0 ;
-
-	flash_info[1].flash_id = FLASH_UNKNOWN;
-	flash_info[1].sector_count = -1;
-
 	flash_info[0].size = size_b0;
-	flash_info[1].size = size_b1;
 
-	return size_b0 + size_b1;
+	return size_b0;
 }
 
 /*-----------------------------------------------------------------------
@@ -181,7 +175,7 @@  static ulong flash_get_size(vu_long *addr, flash_info_t *info)
 
 	/* Write auto select command: read Manufacturer ID */
 
-	debug("Base address is: %08x\n", caddr);
+	debug("Base address is: %8p\n", caddr);
 
 	caddr[0x0555] = 0xAA;
 	caddr[0x02AA] = 0x55;