
5 Nov
2002
5 Nov
'02
12:16 a.m.
Wolfgang Denk wrote:
- 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@idahotech.com