Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/47655 )
Change subject: it85spi.c: Refactor singleton states into reentrant pattern ......................................................................
Patch Set 10: Code-Review-1
(1 comment)
https://review.coreboot.org/c/flashrom/+/47655/10/it85spi.c File it85spi.c:
https://review.coreboot.org/c/flashrom/+/47655/10/it85spi.c@240 PS10, Line 240: struct it85spi_data *data = (struct it85spi_data *) flash->mst->spi.data;
Take away here is... […]
I strongly oppose to the use of casts to discard const qualifiers. If the pointer is referencing data marked as const, then modifying data through this pointer will cause undefined behavior.
I agree that things as-is are pretty messy, but that's the perfect reason to not try to sort this out quickly, and instead re-think the situation thoroughly.