diff options
author | Simon Glass <sjg@chromium.org> | 2016-02-29 15:25:49 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-03-14 15:34:50 -0600 |
commit | a696d768c1274d667be86abe72869461b9fe0073 (patch) | |
tree | e69d3ab2def2dbae84f0cbd7fa0a63c9d4cd4108 /cmd/cbfs.c | |
parent | 3e8bd469504f5d5a8800a2ea46d664dde701105b (diff) | |
download | u-boot-a696d768c1274d667be86abe72869461b9fe0073.tar.gz |
dm: cbfs: Fix handling of invalid type
The comment for file_cbfs_type() says that it returns 0 for an invalid type.
The code appears to check for -1, except that it uses an unsigned variable
to store the type. This results in a warning on 64-bit machines.
Adjust it to make the meaning clearer. Continue to handle the -1 case since
it may be needed.
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'cmd/cbfs.c')
-rw-r--r-- | cmd/cbfs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/cbfs.c b/cmd/cbfs.c index 35d8a7a89b..779e9c043b 100644 --- a/cmd/cbfs.c +++ b/cmd/cbfs.c @@ -103,7 +103,7 @@ int do_cbfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) printf(" size type name\n"); printf("------------------------------------------\n"); while (file) { - u32 type = file_cbfs_type(file); + int type = file_cbfs_type(file); char *type_name = NULL; const char *filename = file_cbfs_name(file); @@ -140,7 +140,8 @@ int do_cbfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) case CBFS_COMPONENT_CMOS_LAYOUT: type_name = "cmos layout"; break; - case -1UL: + case -1: + case 0: type_name = "null"; break; } |