[U-Boot] [PATCH] common/board_f: implement type casting for gd structure

Simon Glass sjg at chromium.org
Mon Mar 2 17:03:27 CET 2015


On 25 February 2015 at 07:59, Alexey Brodkin
<Alexey.Brodkin at 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 at synopsys.com>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Tom Rini <trini at ti.com>
> ---
>  common/board_f.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Acked-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list