From e1f30bbce7a603d518ecec9d7e6885719f396719 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Tue, 20 Dec 2022 12:33:13 +1100 Subject: tree/: Drop default_spi_probe_opcode for NULL case A NULL func pointer is necessary and sufficient for the condition `NULL func pointer => true' as to not need this boilerplate as it implies default behaviour of a supported opcode within the `check_block_eraser()` match supported loop. Ran; ``` $ find . -name '*.[c,h]' -exec sed -i '/.probe_opcode = default_spi_probe_opcode,/d' '{}' \; ``` Change-Id: Id502c5d2596ad1db52faf05723083620e4c52c12 Signed-off-by: Edward O'Callaghan Reviewed-on: https://review.coreboot.org/c/flashrom/+/70264 Tested-by: build bot (Jenkins) Reviewed-by: Thomas Heijligen Reviewed-by: Anastasia Klimchuk --- flashrom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'flashrom.c') diff --git a/flashrom.c b/flashrom.c index 62e57576..3cf67f1d 100644 --- a/flashrom.c +++ b/flashrom.c @@ -470,7 +470,7 @@ int check_block_eraser(const struct flashctx *flash, int k, int log) if (flash->mst->buses_supported & BUS_SPI) { const uint8_t *opcode = spi_get_opcode_from_erasefn(eraser.block_erase); for (int i = 0; opcode[i]; i++) { - if (!flash->mst->spi.probe_opcode(flash, opcode[i])) { + if (!spi_probe_opcode(flash, opcode[i])) { if (log) msg_cdbg("block erase function and layout found " "but SPI master doesn't support the function. "); -- cgit v1.2.3