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