]> git.sur5r.net Git - u-boot/commitdiff
samsung: board: fix: Define loop iterator as an unsigned int to suppress gcc 4.8...
authorŁukasz Majewski <l.majewski@samsung.com>
Wed, 4 Mar 2015 09:54:48 +0000 (10:54 +0100)
committerMinkyu Kang <mk7.kang@samsung.com>
Wed, 4 Mar 2015 11:01:01 +0000 (20:01 +0900)
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 <l.majewski@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
board/samsung/common/board.c

index 6c7f59be87101c48cde630a5ca7efc87e96891ce..97950fa1920e0765b8031ac2066f5804c0b50402 100644 (file)
@@ -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++) {