Anastasia Klimchuk 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:
(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; @Daniel, this is a reply to your comment - for some reasons I can't reply to it because I don't see it in the list of comments.
So I started from this: const struct it85spi_data *data = flash->mst->spi.data; and this required it85xx_enter_scratch_rom argument to become const as well. Ok, makes sense, I made the argument const - but actually, looks like it is modified in the middle of it85xx_enter_scratch_rom , specifically it85spi.c:159:35: error: increment of member 'it85xx_scratch_rom_reenter' in read-only object 159 | data->it85xx_scratch_rom_reenter++;
So data is modified, means it is not const? I realised I can't fix this quickly, I need to understand what's going on here.