* [U-Boot] [PATCH] common/board_f: implement type casting for gd structure
@ 2015-02-25 14:59 Alexey Brodkin
2015-03-02 16:03 ` Simon Glass
2015-03-06 15:47 ` [U-Boot] " Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Alexey Brodkin @ 2015-02-25 14:59 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] common/board_f: implement type casting for gd structure
2015-02-25 14:59 [U-Boot] [PATCH] common/board_f: implement type casting for gd structure Alexey Brodkin
@ 2015-03-02 16:03 ` Simon Glass
2015-03-06 15:47 ` [U-Boot] " Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2015-03-02 16:03 UTC (permalink / raw)
To: u-boot
On 25 February 2015 at 07:59, Alexey Brodkin
<Alexey.Brodkin@synopsys.com> wrote:
> 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(-)
>
Acked-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] common/board_f: implement type casting for gd structure
2015-02-25 14:59 [U-Boot] [PATCH] common/board_f: implement type casting for gd structure Alexey Brodkin
2015-03-02 16:03 ` Simon Glass
@ 2015-03-06 15:47 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2015-03-06 15:47 UTC (permalink / raw)
To: u-boot
On Wed, Feb 25, 2015 at 05:59:02PM +0300, Alexey Brodkin wrote:
> 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>
> Acked-by: Simon Glass <sjg@chromium.org>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150306/3bfee7e2/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-06 15:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-25 14:59 [U-Boot] [PATCH] common/board_f: implement type casting for gd structure Alexey Brodkin
2015-03-02 16:03 ` Simon Glass
2015-03-06 15:47 ` [U-Boot] " Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox