summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Kitching <kitching@chromium.org>2018-06-25 18:34:26 +0000
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2018-06-25 18:37:03 +0000
commitd562212a94eaa757ee2ea44946012110b574601d (patch)
tree3101a2f07a2125f509cfe651e53d8849fb6672c4
parent8a12123d96121eb338a2c7beafb69e2f8b8030f0 (diff)
downloadchrome-ec-d562212a94eaa757ee2ea44946012110b574601d.tar.gz
Revert "host_event_commands: Fix off-by-one error"
This reverts commit c7624254e5ce4da284df9daec696a9dc621cf019. Reason for revert: Re-using 32-bit host events instead. See b/110292722 Original change's description: > host_event_commands: Fix off-by-one error > > This CL fixes two issues: > 1. Host events are 1-based. So, if event0 is being requested to be set > in host_event_set_bit, nothing needs to be done. > 2. To check if event needs to be set in upper 32-bit, check if the > event # is >32 and not >=32. (This issue was identified by coverity ID > 179990). > > BUG=b:69329196 > BRANCH=None > TEST=make -j buildall > > Change-Id: I18b42285bfe187e9f5a32a10a5e1475cdc43f816 > Signed-off-by: Furquan Shaikh <furquan@chromium.org> > Reviewed-on: https://chromium-review.googlesource.com/791862 > Reviewed-by: Randall Spangler <rspangler@chromium.org> > Reviewed-by: Shawn N <shawnn@chromium.org> > (cherry picked from commit c1654d300d2894198f4ca88a7d8426da49d191b5) > Reviewed-on: https://chromium-review.googlesource.com/989868 > Reviewed-by: Joel Kitching <kitching@chromium.org> > Commit-Queue: Joel Kitching <kitching@chromium.org> > Tested-by: Joel Kitching <kitching@chromium.org> > Trybot-Ready: Joel Kitching <kitching@chromium.org> Bug: b:69329196 Change-Id: Id613b02c14ded555cdab9a2e230444df93e91682 Reviewed-on: https://chromium-review.googlesource.com/1113782 Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Trybot-Ready: Joel Kitching <kitching@chromium.org>
-rw-r--r--common/host_event_commands.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/common/host_event_commands.c b/common/host_event_commands.c
index 0f092f6bea..9da08c892c 100644
--- a/common/host_event_commands.c
+++ b/common/host_event_commands.c
@@ -29,16 +29,8 @@ static void host_event_set_bit(host_event_t *ev, uint8_t bit)
uint32_t *ptr = (uint32_t *)ev;
*ev = 0;
-
- /*
- * Host events are 1-based, so return early if event 0 is requested to
- * be set.
- */
- if (bit == 0)
- return;
-
#ifdef CONFIG_HOST_EVENT64
- if (bit > 32)
+ if (bit >= 32)
*(ptr + 1) = HOST_EVENT_32BIT_MASK(bit - 32);
else
#endif