Attention is currently required from: Arthur Heymans, Christian Walter, David Milosevic, Lean Sheng Tan, Maximilian Brune, Nico Huber.
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/74798?usp=email )
Change subject: arch/arm64: Add EL1/EL2/EL3 support for arm64 ......................................................................
Patch Set 5:
(1 comment)
File src/arch/arm64/transition_asm.S:
https://review.coreboot.org/c/coreboot/+/74798/comment/3dfcce3b_111228e0 : PS5, Line 155: mrs x1, currentel
We prefer linker garbage-collection over preprocessing where possible. It […]
It's mostly to prevent bit rot (maybe that's what Nico meant with "test more code at once"?). If you write something like: ``` #if CONFIG_X call_func(a, b, c); #else call_func(a + 1, b, c); #endif ``` and then later someone changes the signature to call_func() to drop the third parameter, and CONFIG_X is a very rarely used option that almost nobody ever enables, it's easy to end up with a situation like: ``` #if CONFIG_X call_func(a, b, c) #else call_func(a + 1, b); #endif ``` Of course if it's just one line it's easy to see, but for bigger blocks it's not uncommon to miss something in the one the author isn't actively testing. Such a mistake can get stuck in a repo for years before anyone will notice, and then you have to do code archaeology to try to figure out how it was actually supposed to be written. If you look at U-Boot code where the policy is to always use #if for compile-time options, it's full of examples of this (or at least it used to back before I decided to never touch it again). Of course a C if() cannot prevent all kinds of bit rot either, but it helps to at least catch the simplest issues.
Preprocessor #ifs also get more ugly when, say, you have a variable that's only used by paths guarded by that #if... then if you compile without it, the compiler will complain that the variable is unused, so you have to wrap yet another #if around the variable definition itself which you otherwise wouldn't have to. Also, it's just ugly (in my opinion).