Attention is currently required from: Nico Huber, Stefan Reinauer, Anastasia Klimchuk. Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/50246 )
Change subject: programmer.h: Convert anon union to anon struct ......................................................................
Patch Set 4:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/50246/comment/9f5e1e45_c1f72a38 PS4, Line 14: The user of the registered_masters type is therefore : responsible for querying the buses_supported field before : attempting to dereference a ptr field in the anon struct.
Can the user check which one out of three is not null?
It's a good question. I guess I mean "user" here to mean things that call "spi_send_command()" such as in spi25.c.
The actual case where this exploded was when w25q_read_status_register_2() used spi_send_command(), which requires that the master be a spi_master where as Hardware-sequenced ICH that is an opaque master was being used.
Essentially the union is a bit of a trap.