diff options
Diffstat (limited to 'util/ectool.cc')
-rw-r--r-- | util/ectool.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/util/ectool.cc b/util/ectool.cc index 86c4210fba..eac89a89dd 100644 --- a/util/ectool.cc +++ b/util/ectool.cc @@ -10874,7 +10874,12 @@ int cmd_wait_event(int argc, char *argv[]) char *e; BUILD_ASSERT(ARRAY_SIZE(mkbp_event_text) == EC_MKBP_EVENT_COUNT); - BUILD_ASSERT(ARRAY_SIZE(host_event_text) == 33); /* events start at 1 */ + /* + * Only 64 host events are supported. The enum |host_event_code| uses + * 1-based counting so it can skip 0 (NONE). The last legal host event + * number is 64, so ARRAY_SIZE(host_event_text) <= 64+1. + */ + BUILD_ASSERT(ARRAY_SIZE(host_event_text) <= 65); if (!ec_pollevent) { fprintf(stderr, "Polling for MKBP event not supported\n"); @@ -10922,7 +10927,7 @@ int cmd_wait_event(int argc, char *argv[]) switch (event_type) { case EC_MKBP_EVENT_HOST_EVENT: printf("Host events:"); - for (int evt = 1; evt <= 32; evt++) { + for (int evt = 1; evt < ARRAY_SIZE(host_event_text); evt++) { if (buffer.data.host_event & EC_HOST_EVENT_MASK(evt)) { const char *name = host_event_text[evt]; |