Attention is currently required from: Felix Singer, Nico Huber, Angel Pons. Benjamin Doron has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35523 )
Change subject: mb/acer: Add Acer Aspire VN7-572G ......................................................................
Patch Set 170:
(1 comment)
File src/mainboard/acer/aspire_vn7_572g/gpio.h:
PS165:
If each definition is used in exactly one compilation unit, the definitions can instead be placed directly into the corresponding compilation unit
But this isn't to reduce the number of files, clearly.
Please do not quote me out of context, especially if then going to argue about something I did not say.
Sorry, arguing was not my intention and I will try to use "quote" properly in the future. I was responding to you to clarify the objective here, but I could certainly have worded myself better.
Is this, like CB:48823, intended to minimise the likelihood of mistaken usages? Otherwise, I can't see how the tables would be used multiple times.
No, CB:34876 would be closer. On this patchset, two compilation units include this header, but each array is only used in one compilation unit, so the toolchain removes the unused definitions and the final coreboot image contains one copy of each array.
That's what I expected. Then, what is the aim here? Is it perhaps consistency?
As an example, let's suppose you used `gpio_table` in `hda_verb.c` and `mainboard.c`. The object files for these compilation units would both contain the GPIO table, and the resulting coreboot image would thus have two copies of the GPIO table.
I admit that would be problematic, particularly because it could overwrite GPIO state.
To solve the case above, one would need to drop the `static` qualifier, declare (not define) the arrays in a header, define the array in exactly one compilation unit, and include the header where said array is referenced.