diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2018-10-05 18:06:38 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-10-08 22:23:19 -0700 |
commit | c03186c5b5d4f84e3f1fafae34ed53750760ba2a (patch) | |
tree | 000ba975b91abcbb704f77a316ccc6e33f42d4f2 /util/iteflash.c | |
parent | ec8b4d1de8e60d3482594ffdf19279051b880251 (diff) | |
download | chrome-ec-c03186c5b5d4f84e3f1fafae34ed53750760ba2a.tar.gz |
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 <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1266676
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'util/iteflash.c')
-rw-r--r-- | util/iteflash.c | 7 |
1 files 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: |