Attention is currently required from: Nico Huber, Edward O'Callaghan, Angel Pons, Simon Glass. Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/51487 )
Change subject: tests: Add unit test to run init/shutdown for mec1308.c, ene_lpc.c ......................................................................
Patch Set 10:
(1 comment)
File tests/init_shutdown.c:
https://review.coreboot.org/c/flashrom/+/51487/comment/d0246473_9c4eb258 PS10, Line 53: MEC1308_SIO_PORT1
OK. […]
Nico, Simon, thank you so much for this conversation, really useful for me to read! I can understand both approaches, but I am taking the side of leaving #defines in the driver code where they are (especially because I was on that side from the beginning).
This point I think is really important:
Pulling such definitions out of their compilation unit makes it easier to write tests I suppose. But it also makes it harder to read/review the code.
I don't want to make it harder to read/review the code. For tests, I can address read/review with comments like 0x20 /* MEC1308_DEVICE_ID_REG */
Also, how often those values change, for a given chip? Is it ~never? Please correct me if I am wrong.
Another thing I want to say about
I don't think we should be afraid to modify the code as needed for tests.
Not afraid, but need to be very very careful. It is like walking on ice...