From c03186c5b5d4f84e3f1fafae34ed53750760ba2a Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Fri, 5 Oct 2018 18:06:38 -0700 Subject: iteflash: tweak verify_flash() There is no point in comparing read buffer with the file contents in case flash contents read back failed. BRANCH=none BUG=none TEST=verified that running $ make BOARD=dragonegg -j $ ./util/flash_ec --board=dragonegg still succeeds when servod is running and the DUT is connected through the servo-v2 board. Change-Id: I8cd33140be4e834490b368df58aa2fd4546fe280 Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/1266676 Reviewed-by: Jett Rink --- util/iteflash.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/util/iteflash.c b/util/iteflash.c index d0c79fa0cb..08db0a0a04 100644 --- a/util/iteflash.c +++ b/util/iteflash.c @@ -1354,7 +1354,7 @@ failed_write: } -/* Return zero on success, a negative error value on failures. */ +/* Return zero on success, a non-zero value on failures. */ int verify_flash(struct common_hnd *chnd, const char *filename, uint32_t offset) { @@ -1388,8 +1388,9 @@ int verify_flash(struct common_hnd *chnd, const char *filename, printf("Verify %d bytes at 0x%08x\n", file_size, offset); res = command_read_pages(chnd, offset, flash_size, buffer2); - draw_spinner(flash_size-res, flash_size); - res = memcmp(buffer, buffer2, file_size); + if (res > 0) + res = memcmp(buffer, buffer2, file_size); + printf("\n\rVerify %s\n", res ? "Failed!" : "Done."); exit: -- cgit v1.2.1