From 3c44e12a287ce9a91cf97c3303bf4222f63d25c7 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Wed, 2 Nov 2022 12:15:38 +1100 Subject: tree/: Convert flashchips db to use indirection for erase_block This paves the way to allow for the conversion of flashchip erase_block func ptr to enumerate values. This change should be a NOP. TEST=`diff -u <(objdump -D flashchips.o_bk) <(objdump -D flashchips.o)`. Change-Id: I122295ec9add0fe0efd27273c9725e5d64f6dbe2 Signed-off-by: Edward O'Callaghan Reviewed-on: https://review.coreboot.org/c/flashrom/+/69131 Reviewed-by: Angel Pons Reviewed-by: Anastasia Klimchuk Tested-by: build bot (Jenkins) --- flashrom.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'flashrom.c') diff --git a/flashrom.c b/flashrom.c index e2452c9a6..08e3969e0 100644 --- a/flashrom.c +++ b/flashrom.c @@ -340,18 +340,18 @@ static int check_block_eraser(const struct flashctx *flash, int k, int log) { struct block_eraser eraser = flash->chip->block_erasers[k]; - if (!eraser.block_erase && !eraser.eraseblocks[0].count) { + if (eraser.block_erase == NO_BLOCK_ERASE_FUNC && !eraser.eraseblocks[0].count) { if (log) msg_cdbg("not defined. "); return 1; } - if (!eraser.block_erase && eraser.eraseblocks[0].count) { + if (eraser.block_erase == NO_BLOCK_ERASE_FUNC && eraser.eraseblocks[0].count) { if (log) msg_cdbg("eraseblock layout is known, but matching " "block erase function is not implemented. "); return 1; } - if (eraser.block_erase && !eraser.eraseblocks[0].count) { + if (eraser.block_erase != NO_BLOCK_ERASE_FUNC && !eraser.eraseblocks[0].count) { if (log) msg_cdbg("block erase function found, but " "eraseblock layout is not defined. "); -- cgit v1.2.3