* [U-Boot] [PATCH] samsung: board: fix: Define loop iterator as an unsigned int to suppress gcc 4.8 warning
@ 2015-03-04 9:54 Lukasz Majewski
2015-03-04 12:07 ` Minkyu Kang
0 siblings, 1 reply; 2+ messages in thread
From: Lukasz Majewski @ 2015-03-04 9:54 UTC (permalink / raw)
To: u-boot
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>
---
board/samsung/common/board.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index 7b10877..d8cf5ab 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -89,7 +89,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++) {
@@ -101,7 +101,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++) {
--
2.0.0.rc2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH] samsung: board: fix: Define loop iterator as an unsigned int to suppress gcc 4.8 warning
2015-03-04 9:54 [U-Boot] [PATCH] samsung: board: fix: Define loop iterator as an unsigned int to suppress gcc 4.8 warning Lukasz Majewski
@ 2015-03-04 12:07 ` Minkyu Kang
0 siblings, 0 replies; 2+ messages in thread
From: Minkyu Kang @ 2015-03-04 12:07 UTC (permalink / raw)
To: u-boot
On 04/03/15 18:54, Lukasz Majewski wrote:
> 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>
> ---
> board/samsung/common/board.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
> index 7b10877..d8cf5ab 100644
> --- a/board/samsung/common/board.c
> +++ b/board/samsung/common/board.c
> @@ -89,7 +89,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++) {
> @@ -101,7 +101,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++) {
>
applied to u-boot-samsung.
Thanks,
Minkyu Kang.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-04 12:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-04 9:54 [U-Boot] [PATCH] samsung: board: fix: Define loop iterator as an unsigned int to suppress gcc 4.8 warning Lukasz Majewski
2015-03-04 12:07 ` Minkyu Kang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox