Attention is currently required from: Angel Pons, Nikolai Artemiev, Sergii Dmytruk. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/58478 )
Change subject: writeprotect.h: add structure to represent chip wp configuration bits ......................................................................
Patch Set 30: Code-Review+1
(1 comment)
File writeprotect.h:
https://review.coreboot.org/c/flashrom/+/58478/comment/7fdb8f49_b727ccf4 PS30, Line 39: /* Complement bit (CMP) */ : bool cmp_bit_present; : uint8_t cmp; : : /* Sector/block protection bit (SEC) */ : bool sec_bit_present; : uint8_t sec; : : /* Top/bottom protection bit (TB) */ : bool tb_bit_present; : uint8_t tb; Something I didn't notice earlier: The `_present` flags are only consumed when interpreting the range. And there, a `_present == false` is always treated the same as if the bit itself is 0. So, AFAICS, the code would still do the same if we'd drop the flags (if not present bits are 0 initialzed).
I guess that's a matter of taste. Leaner code vs. more explicit code.