[ARMboot-users] Re: [U-Boot-Users] [PATCH] update for CSB226

Rich Ireland rich.ireland at idahotech.com
Tue Nov 5 00:16:23 CET 2002


Wolfgang Denk wrote:
> 
> 2) Many of these #ifdef's are used to conditionammy define variables,
>    or initializers, where an if() cannot be used, so we would have to
>    support BOTH forms, which is actually worse.

Yep, supporting both methods would be very bad.

IMNSHO,

#ifdef MISC_INIT_R
	misc_init_r();
#endif

is better.  But then you have to get all the board maintainers to define 
MISC_INIT_R properly.

One could just remove all the 'board specific' defines from this and 
wait for the patches to arrive... ;-)

Personally, I prefer to have all init functions defined for each 
supported board and skip all the if'def blocks all together. Either by 
an empty #define or an empty function.

This makes everything *much* more readable.

Yes, there are exceptions, but (in a perfect world) generic code 
shouldn't have board specific references at all.  Let the linker do it's 
job.

Just my 2/100th's of a USD.

-- 
Rich Ireland
Firmware Engineer
Idaho Technology, Inc.
http://www.idahotech.com/
mailto:rich.ireland at idahotech.com






More information about the U-Boot mailing list