[U-Boot] [PATCH v2] board_r - fixup functions table after relocation

Masahiro Yamada yamada.m at jp.panasonic.com
Mon Jan 20 11:05:55 CET 2014


Hello Alexey,


> diff --git a/common/board_r.c b/common/board_r.c
> index 86ca1cb..3462590 100644
> --- a/common/board_r.c
> +++ b/common/board_r.c
> @@ -903,9 +903,16 @@ init_fnc_t init_sequence_r[] = {
>  
>  void board_init_r(gd_t *new_gd, ulong dest_addr)
>  {
> +	int i;

This emits a warning if CONFIG_NEED_MANUAL_RELOC is not defined.

For example, arndale board:

board_r.c: In function 'board_init_r':
board_r.c:906:6: warning: unused variable 'i' [-Wunused-variable]


>  #ifndef CONFIG_X86
>  	gd = new_gd;
>  #endif
> +
> +#ifdef CONFIG_NEEDS_MANUAL_RELOC
> +	for (i = 0; i < sizeof(init_sequence_r)/sizeof(void *); i++)
> +		init_sequence_r[i] += gd->reloc_off;
> +#endif
> +

Please use ARRAY_SIZE as Simon suggested.


Best Regards
Masahiro Yamada



More information about the U-Boot mailing list