[U-Boot] [PATCH V2] arm/board.c: avoid ifdef using weak default functions

Tom Tom.Rix at windriver.com
Thu Nov 26 20:18:22 CET 2009


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 am interested in flexibility and maintainability.
Not so much on size.

Tom
>     Jocke
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot



More information about the U-Boot mailing list