[U-Boot] [PATCH V2] arm/board.c: avoid ifdef using weak default functions
Joakim Tjernlund
joakim.tjernlund at transmode.se
Fri Nov 27 11:37:22 CET 2009
Tom <Tom.Rix at windriver.com> wrote on 26/11/2009 20:18:22:
>
> Joakim Tjernlund wrote:
> >> From: Alessandro Rubini <rubini at unipv.it>
> >>
> >> While it's a matter of personal taste, I prefer to avoid ifdef when
> >> possible. For example, I don't like to add BOARD_LATE_INIT in the
> >> config file just to add a board_late_init() function.
> >> Also, I think the file is more readable without the ifdef stuff.
> >> This uses two trivial weak functions to provide defaults for all
> >> functions that were ifdeffed.
> >>
> >> This patch was initially rejected in favor of a initcall mechanism
> >> but that approach is not a work in progress any ore.
> >> ---
> >>
> >> One complaint I got about this is the runtime overhead. Actually,
> >> normal_nop is two instructions (plus the call to it) and void_nop
> >> is one instruction (plus the call), similar to the overhead in
> >> led management for platforms with no leds.
> >
> > I think (I have proposed this before) that you should get rid of
> > the init_fnc_t *init_sequence[] array all together. It only
> > adds relocation overhead(lots of it). Just make the array a function
> > that calls the init functions directly.
> >
>
> Please resend the RFC patch.
> This would also go the arm/testing-arm_init branch.
I just sent a complete patch for ppc(as that is my platform).
You choose if you want to do a similar one for ARM.
There probably wont be any space savings for ARM as
you don't use relocation yet.
Jocke
More information about the U-Boot
mailing list