Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35588 )
Change subject: console: Declare empty printk() for __ROMCC__ ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35588/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/35588/2//COMMIT_MSG@11 PS2, Line 11:
See CB:35616 where that 'do {} while (0)' increases romcc register usage. I am not quite sure why e.g. <arch/smp/spinlock.h> does not define empty macros if they would work everywhere?
The empty inline doesn't cause the same problems as 'do {} while (0)'?
As for empty macros... I think it's largely microcode and console are likely the only places this was a problem w/ romcc. And as your patch shows those were being explicitly handled by open coding out the problematic sequences. But with empty macros it creates dangling ';' which can cause issues depending on how the code is done.
I personally am not a fan of romcc because of its shortcomings w.r.t. code portability. And for so long most things were #if'd out.