diff options
author | Che-Liang Chiou <clchiou@chromium.org> | 2011-07-20 18:42:29 +0800 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:59:03 -0700 |
commit | bce870b71d2af4ee8a7989db7b0fe2b5e4cdd550 (patch) | |
tree | 2c6873576c0e9ac4e61adceceec1329eac8b8fb5 /common/cmd_vbexport_test.c | |
parent | 7382683d723ce5106d92102c522ed4251551cec4 (diff) |
CHROMIUM: fix error of showing eMMC as a removable disk
It is too bad that I did not catch this when I tested the cleanup patch.
To avoid that from happening again, more checks are added to
"vbexport_test diskinfo" that prints out an error message when the flag
of any probed storage device mismatches the given flag.
BUG=chromium-os:16542
TEST=manual
When no SD card and USB key is inserted, vbexport_test diskinfo prints
"No disk found!" under "Detecting all removable disks..." test.
Change-Id: I0e20a6337c7cd638b883cf36416fdb3ae5bd3071
Reviewed-on: http://gerrit.chromium.org/gerrit/4392
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Diffstat (limited to 'common/cmd_vbexport_test.c')
-rw-r--r-- | common/cmd_vbexport_test.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/common/cmd_vbexport_test.c b/common/cmd_vbexport_test.c index 7da84a0993..72389170ac 100644 --- a/common/cmd_vbexport_test.c +++ b/common/cmd_vbexport_test.c @@ -185,16 +185,22 @@ static int do_vbexport_test_diskinfo_flags(uint32_t flags) } else { VbExDebug("handle byte/lba lba_count f name\n"); for (i = 0; i < count; i++) { - VbExDebug("%08lx %-9llu %-10llu %-2lu %s\n", + VbExDebug("%08lx %-9llu %-10llu %-2lu %s", info[i].handle, info[i].bytes_per_lba, info[i].lba_count, info[i].flags, info[i].name); + + if (!(flags & info[i].flags)) { + VbExDebug(" INCORRECT: flag mismatched\n"); + ret = 1; + } else + VbExDebug("\n"); } } - return VbExDiskFreeInfo(info, NULL); + return VbExDiskFreeInfo(info, NULL) || ret; } static int do_vbexport_test_diskinfo( |