summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@chromium.org>2017-11-15 07:41:08 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-11-15 13:23:34 -0800
commit6c92b0fcd08d00134f66d879d75a55d1cede5822 (patch)
tree447383bef3a30015d33ef336e5fc87478b983f82
parent5cee174602d8ea851cc434a2f07b71e21cbaa214 (diff)
downloadchrome-ec-6c92b0fcd08d00134f66d879d75a55d1cede5822.tar.gz
samus: Change the way host_set_single_event is used
In order to avoid runtime 64-bit left shift, check for extpower and add two separate calls to host_set_single_event rather than calculating the parameter at runtime. This avoids the requirement of runtime logical shift for 64-bit. BUG=b:69329196 BRANCH=None TEST=make -j BOARD=samus Change-Id: I64cacf6253878ed7d69f6b17baeb6c27c470378a Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/771854 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/samus/extpower.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/board/samus/extpower.c b/board/samus/extpower.c
index 513bed48cd..c2fabbd35e 100644
--- a/board/samus/extpower.c
+++ b/board/samus/extpower.c
@@ -415,8 +415,11 @@ void extpower_task(void)
hook_notify(HOOK_AC_CHANGE);
/* Forward notification to host */
- host_set_single_event(extpower ?
- EC_HOST_EVENT_AC_CONNECTED :
+ if (extpower)
+ host_set_single_event(
+ EC_HOST_EVENT_AC_CONNECTED);
+ else
+ host_set_single_event(
EC_HOST_EVENT_AC_DISCONNECTED);
}
}