diff mbox

[U-Boot,V3] nitrogen: Use unsigned long to specify the total RAM size

Message ID 1363248207-11829-1-git-send-email-sbabic@denx.de
State Rejected
Delegated to: Stefano Babic
Headers show

Commit Message

Stefano Babic March 14, 2013, 8:03 a.m. UTC
From: "fabio.estevam@freescale.com" <fabio.estevam@freescale.com>

When building for the nitrogen boards with 2GB the following warning happens:

nitrogen6x.c:89:38: warning: integer overflow in expression [-Woverflow]

2GB can not fit in 32-bits, so use ulong instead.

Reported-by: Albert Aribaud <albert.u.boot@aribaud.net>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Stefano Babic <sbabic@denx.de>
---

Changes since V1:
	- move casting inside expression to force using unsigned long

 board/boundary/nitrogen6x/nitrogen6x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefano Babic March 14, 2013, 8:08 a.m. UTC | #1
On 14/03/2013 09:03, Stefano Babic wrote:
> From: "fabio.estevam@freescale.com" <fabio.estevam@freescale.com>
> 
> When building for the nitrogen boards with 2GB the following warning happens:
> 
> nitrogen6x.c:89:38: warning: integer overflow in expression [-Woverflow]
> 
> 2GB can not fit in 32-bits, so use ulong instead.
> 
> Reported-by: Albert Aribaud <albert.u.boot@aribaud.net>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> ---
> 

Sorry, discharge this - it is identical to the previous one. I will send
the right one in few minutes.

Stefano
diff mbox

Patch

diff --git a/board/boundary/nitrogen6x/nitrogen6x.c b/board/boundary/nitrogen6x/nitrogen6x.c
index 0dbb6d2..e5634d8 100644
--- a/board/boundary/nitrogen6x/nitrogen6x.c
+++ b/board/boundary/nitrogen6x/nitrogen6x.c
@@ -86,7 +86,7 @@  DECLARE_GLOBAL_DATA_PTR;
 
 int dram_init(void)
 {
-	gd->ram_size = CONFIG_DDR_MB * 1024 * 1024;
+	gd->ram_size = (ulong)(CONFIG_DDR_MB * 1024 * 1024);
 
 	return 0;
 }