[coreboot] The fallacy of the CONFIG_* plague

Peter Stuge peter at stuge.se
Wed Feb 12 19:40:58 CET 2014


mrnuke wrote:
> So, instead of having a generic function doing
>  #if IS_ENABLED(CONFIG_HAVE_LOLLIPOP)
> 	printk(BIOS_YUMMY, "Sucking on a lollipop\n");
>  #else
> 	printk(BIOS_SUCKY, "Meanie!!\n");
>  #endif
> 
> We make it dynamically polymorphic:
>  	if (has_lollipop)
> 		printk(BIOS_YUMMY, "Sucking on a lollipop\n");
>  	else
> 		printk(BIOS_INFO, "Mister stole my lollipop\n");
..
> Thoughts, comments, concerns, paint ideas?

There is significant benefit in not having any run-time data at all,
because then there can not be run-time issues caused by incorrect or
simply unexpected data.

There is also significant benefit in having generic code.

But there is generic and there is generic. If something is known
already at build-time then I think it's a bad idea to push the
decision to run-time.


//Peter



More information about the coreboot mailing list