1 comment:
Patch Set #10, 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 […]
Take away here is... yes, `const`-ification causes one to think a bit harder about what parameters / objects should be being modified and where. This is generally a good thing, but takes more time and effort to get just right.
I think I was only actually partially incorrect in the earlier analysis. The `const struct flashctx *flash` may not be the issue, but rather the fact that `struct spi_master` itself defines a `const void *data`:
https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/third_party/flashrom/programmer.h;l=660
This suggests that the current intention is that spi_master's `data` fields are immutable state, and should not be modified at runtime.
This sounds like a more fundamental issue with this patch series. I suggest forking off a separate stand-alone preliminary patch to de-constify's `data` in the common code, before this patch that re-purposes it for use to point to modifiable runtime state in this spi_master driver.
To view, visit change 47655. To unsubscribe, or for help writing mail filters, visit settings.