diff options
author | Nikolai Artemiev <nartemiev@google.com> | 2022-11-28 17:40:56 +1100 |
---|---|---|
committer | Edward O'Callaghan <quasisec@chromium.org> | 2022-12-04 23:21:09 +0000 |
commit | e31d721469a37bd5784b86ffcd2318108a796616 (patch) | |
tree | f9add187cc0b2abdcbe0c644e52002502c8c49a8 /dummyflasher.c | |
parent | eda27e4d1b23ac602b76c3f99b02a791953e9eed (diff) | |
download | flashrom-e31d721469a37bd5784b86ffcd2318108a796616.tar.gz flashrom-e31d721469a37bd5784b86ffcd2318108a796616.tar.bz2 flashrom-e31d721469a37bd5784b86ffcd2318108a796616.zip |
tree/: Make probe_opcode() flashctx argument const
Probing an opcode generally shouldn't involve mutating the flashctx
state and currently no probe_opcode functions do that.
Make the flashctx arg const so that call sites don't need to have a
non-const pointer.
BUG=b:253715389,b:253713774
BRANCH=none
TEST=ninja test
Change-Id: I19e98be50d682de2d2715417f8b7b8c62b871617
Signed-off-by: Nikolai Artemiev <nartemiev@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/70030
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'dummyflasher.c')
-rw-r--r-- | dummyflasher.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dummyflasher.c b/dummyflasher.c index 35cdfef0..da4efc79 100644 --- a/dummyflasher.c +++ b/dummyflasher.c @@ -122,10 +122,10 @@ static int dummy_spi_write_256(struct flashctx *flash, const uint8_t *buf, unsig emu_data->spi_write_256_chunksize); } -static bool dummy_spi_probe_opcode(struct flashctx *flash, uint8_t opcode) +static bool dummy_spi_probe_opcode(const struct flashctx *flash, uint8_t opcode) { size_t i; - struct emu_data *emu_data = flash->mst->spi.data; + const struct emu_data *emu_data = flash->mst->spi.data; for (i = 0; i < emu_data->spi_blacklist_size; i++) { if (emu_data->spi_blacklist[i] == opcode) return false; |