Attention is currently required from: Thomas Heijligen, Edward O'Callaghan, Angel Pons, Anastasia Klimchuk. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52945 )
Change subject: programmer_table: convert entries to pointers ......................................................................
Patch Set 5: Code-Review+2
(4 comments)
File flashrom.c:
https://review.coreboot.org/c/flashrom/+/52945/comment/25772f14_435d61c2 PS3, Line 1716: programmer_table_size != PROGRAMMER_INVALID
Now after I read the whole chain of commits, this doesn't matter anymore.
The answer is in the way how the enum was declared, with all the #if. It made PROGRAMMER_INVALID reflect the number of _valid_ programmers. This number is constant, no matter if there is a terminating, invalid entry.
File print_wiki.c:
https://review.coreboot.org/c/flashrom/+/52945/comment/cdef074d_fc90b7f8 PS3, Line 403: *prog This is what I meant with "and below", apparently.
https://review.coreboot.org/c/flashrom/+/52945/comment/2f69093b_4b7d3a88 PS3, Line 415: *prog and this
https://review.coreboot.org/c/flashrom/+/52945/comment/9fbcdf21_a0748e8b PS3, Line 429: *prog and this
Actually, in loops that don't need an index, we could also use a pointer as iterator, e.g.
const struct programmer_entry *prog; for (prog = programmer_table; prog < programmer_table + PROGRAMMER_INVALID; ++prog)
Though, that's not what people are used to, I assume.