U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] common/board_f: implement type casting for gd structure
Date: Wed, 25 Feb 2015 17:59:02 +0300	[thread overview]
Message-ID: <1424876342-12200-1-git-send-email-abrodkin@synopsys.com> (raw)

In case of global data structure defined as "register volatile" compiler
throws an warning about incorrect type used:
 --->8---
 common/board_f.c: In function "board_init_f_r":
 common/board_f.c:1073:2: warning: passing argument 1 of "&board_init_r
 +(sizetype)gd->reloc_off" discards "volatile" qualifier from pointer
 target type [enabled by default]
  (board_init_r + gd->reloc_off)(gd, gd->relocaddr);
  ^
 common/board_f.c:1073:2: note: expected "struct gd_t *" but argument is
 of type "volatile struct gd_t *"
 --->8---

An obvious fix is manual casting to "gd_t *".

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@ti.com>
---
 common/board_f.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/board_f.c b/common/board_f.c
index a1dcc5f..96a23ae 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -1070,7 +1070,7 @@ void board_init_f_r(void)
 	 * Transfer execution from Flash to RAM by calculating the address
 	 * of the in-RAM copy of board_init_r() and calling it
 	 */
-	(board_init_r + gd->reloc_off)(gd, gd->relocaddr);
+	(board_init_r + gd->reloc_off)((gd_t *)gd, gd->relocaddr);
 
 	/* NOTREACHED - board_init_r() does not return */
 	hang();
-- 
2.1.0

             reply	other threads:[~2015-02-25 14:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25 14:59 Alexey Brodkin [this message]
2015-03-02 16:03 ` [U-Boot] [PATCH] common/board_f: implement type casting for gd structure Simon Glass
2015-03-06 15:47 ` [U-Boot] " Tom Rini

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=1424876342-12200-1-git-send-email-abrodkin@synopsys.com \
    --to=alexey.brodkin@synopsys.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