public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Minkyu Kang <mk7.kang@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] samsung: board: fix: Define loop iterator as an unsigned int to suppress gcc 4.8 warning
Date: Wed, 04 Mar 2015 21:07:30 +0900	[thread overview]
Message-ID: <54F6F582.5080609@samsung.com> (raw)
In-Reply-To: <1425462888-21190-1-git-send-email-l.majewski@samsung.com>

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.

      reply	other threads:[~2015-03-04 12:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54F6F582.5080609@samsung.com \
    --to=mk7.kang@samsung.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox