From: Alexey Brodkin Date: Wed, 25 Feb 2015 14:59:02 +0000 (+0300) Subject: common/board_f: implement type casting for gd structure X-Git-Tag: KARO-TX6-2015-09-18~3381 X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=commitdiff_plain;h=9325d5d01aa8df55f955065a24a6526b06a90d61 common/board_f: implement type casting for gd structure 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 Cc: Simon Glass Cc: Tom Rini Acked-by: Simon Glass --- diff --git a/common/board_f.c b/common/board_f.c index c265379d9b..8314d1247f 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -1081,7 +1081,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();