summaryrefslogtreecommitdiff
path: root/util/ectool.c
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2021-04-30 16:28:07 -0700
committerCommit Bot <commit-bot@chromium.org>2021-05-03 21:40:35 +0000
commit214cf91968de5e4ddd83797bac7a7ef4dc0318e4 (patch)
treec81c46c70969efb6960f7f6eb51dd743212bffeb /util/ectool.c
parent190b5bbd4b89dbe561073226ae34a89e067e46e6 (diff)
downloadchrome-ec-214cf91968de5e4ddd83797bac7a7ef4dc0318e4.tar.gz
util/ectool: Initialize enum with correct type
When compiling with C++, the original code fails with: error: cannot initialize a variable of type 'enum sysinfo_fields' with an rvalue of type 'int' enum sysinfo_fields fields = 0; BRANCH=none BUG=b:144959033 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I3920db2d2dac426e5514657f8499dda6b66e65a2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2864518 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'util/ectool.c')
-rw-r--r--util/ectool.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/ectool.c b/util/ectool.c
index e8a57c031d..fb0d9ea1f6 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -1830,6 +1830,7 @@ int cmd_rwsig(int argc, char **argv)
}
enum sysinfo_fields {
+ SYSINFO_FIELD_NONE = 0,
SYSINFO_FIELD_RESET_FLAGS = BIT(0),
SYSINFO_FIELD_CURRENT_IMAGE = BIT(1),
SYSINFO_FIELD_FLAGS = BIT(2),
@@ -1854,7 +1855,7 @@ static int sysinfo(struct ec_response_sysinfo *info)
int cmd_sysinfo(int argc, char **argv)
{
struct ec_response_sysinfo r;
- enum sysinfo_fields fields = 0;
+ enum sysinfo_fields fields = SYSINFO_FIELD_NONE;
bool print_prefix = false;
if (argc != 1 && argc != 2)