]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
common/board_f: implement type casting for gd structure
authorAlexey Brodkin <Alexey.Brodkin@synopsys.com>
Wed, 25 Feb 2015 14:59:02 +0000 (17:59 +0300)
committerTom Rini <trini@konsulko.com>
Fri, 6 Mar 2015 01:50:29 +0000 (20:50 -0500)
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>
common/board_f.c

index 1989c8193d28628381953272bf0fac2753ac40ca..fc3e7ddd10b8557678e913fc6e269e6071726725 100644 (file)
@@ -1062,7 +1062,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
         */
         * 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();
 
        /* NOTREACHED - board_init_r() does not return */
        hang();