Attention is currently required from: Felix Singer, Edward O'Callaghan, Angel Pons, Anastasia Klimchuk.
Alexander Goncharov has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/73039 )
Change subject: flashrom: rewrite flashbuses_to_text() ......................................................................
Patch Set 6:
(1 comment)
File flashrom.c:
https://review.coreboot.org/c/flashrom/+/73039/comment/7f242791_a8db8939 PS5, Line 948: if (bustype & (1 << i))
Oh that my question was a silly one, sorry. […]
Came back with fresh ideas, I see that it's possible to use a struct:
``` struct bus_type_info { enum chipbustype type; const char *name; };
static const struct bus_type_info bustypes[] = { { BUS_PARALLEL, "Parallel, " }, { BUS_LPC, "LPC, " }, { BUS_FWH, "FWH, " }, { BUS_SPI, "SPI, " }, { BUS_PROG, "Programmer-specific, " }, }; ```
And then:
``` for (unsigned int i = 0; i < ARRAY_SIZE(bustypes); i++) { if (bustype & bustypes[i].type) { ... } } ```
Looks like it resolves the problem that you mentioned. Do you think that's an appropriate implementation?