From: Ɓukasz Majewski Date: Wed, 4 Mar 2015 09:54:48 +0000 (+0100) Subject: samsung: board: fix: Define loop iterator as an unsigned int to suppress gcc 4.8... X-Git-Tag: v2015.04-rc4~125^2~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c8b71a35289112f77691df0d0b4a97ef19dac87b;p=u-boot samsung: board: fix: Define loop iterator as an unsigned int to suppress gcc 4.8 warning This patch suppress following warning: board/samsung/common/board.c:95:32: warning: iteration 4u invokes undefined behavior [-Waggressive-loop-optimizations] addr = CONFIG_SYS_SDRAM_BASE + (i * SDRAM_BANK_SIZE); ^ board/samsung/common/board.c:94:2: note: containing loop about possible signed integer overflow at gcc 4.8.2 (odroid board) Signed-off-by: Lukasz Majewski Signed-off-by: Minkyu Kang --- diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c index 6c7f59be87..97950fa192 100644 --- a/board/samsung/common/board.c +++ b/board/samsung/common/board.c @@ -88,7 +88,7 @@ int board_init(void) int dram_init(void) { - int i; + unsigned int i; u32 addr; for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { @@ -100,7 +100,7 @@ int dram_init(void) void dram_init_banksize(void) { - int i; + unsigned int i; u32 addr, size; for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {