[U-Boot] [PATCH] ppc: transform init_sequence into a function.

Alessandro Rubini rubini-list at gnudd.com
Fri Nov 27 15:54:57 CET 2009


> I think most of the ugliness comes from the #ifdef hell in this list.
> replacing the #ifdefs is another matter so looking behind
> the #ifdef mess, I don't think it looks too bad.

I think the approach I took with lib_arm/board.c may apply as well.
A simple weak init_nop(), no change at all in board code and
no more "CONFIG_BOARD_EARLY_INIT_F" kind of stuff.

>> This is much more ugly, and I cannot see why it would be easier to
>> debug.
> 
> You can set breakpoints anywhere you like. When it crashes in here
> somewhere, it isn't easy to tell where it did so.

I agree it is uglier (and I've discussed with Joakim offlist), this is
a very strong point. I never had problems with the u-boot init
function, I had serious issues with kernel initcalls.

Whils debug_initcall is great and good in the kernel, we can't do with
printf ini u-boot, not in the first steps, at least.

So while I strongly prefer data structures to a burst of "if () goto error;",
I think Joakim has a point here -- after I argued against it offlist.

/alessandro


More information about the U-Boot mailing list