diff options
author | Tom Hughes <tomhughes@chromium.org> | 2021-05-03 17:09:31 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-05-04 18:29:36 +0000 |
commit | 0d2011eed89c208fe561b2f0909830821cda8999 (patch) | |
tree | 712c373acebb21ee976f38b2751916c9f356f954 /util | |
parent | 24b67a2f49485f3d5adeb9530b22f5956865cd3a (diff) | |
download | chrome-ec-0d2011eed89c208fe561b2f0909830821cda8999.tar.gz |
util/ectool: Use UINT32_MAX instead of -1
When compiling with C++, the conversion from "int" to "unsigned int"
generates a compiler error:
util/ectool.cc:5545:19: error: constant expression evaluates to -1 which
cannot be narrowed to type 'uint32_t' (aka 'unsigned int')
[-Wc++11-narrowing]
.number_data = -1,
^~
BRANCH=none
BUG=b:144959033
TEST=make buildall
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: If810a0f68cfdf09c3ca44a7e9233006cad188e39
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2870385
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/ectool.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/ectool.c b/util/ectool.c index ab79b5770d..04a8f13e23 100644 --- a/util/ectool.c +++ b/util/ectool.c @@ -5525,7 +5525,7 @@ static int cmd_motionsense(int argc, char **argv) uint32_t number_data; struct ec_response_motion_sensor_data data[512]; } fifo_read_buffer = { - .number_data = -1, + .number_data = UINT32_MAX, }; int print_data = 0, max_data = strtol(argv[2], &e, 0); |