diff options
author | Dino Li <Dino.Li@ite.com.tw> | 2016-09-13 13:21:11 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-09-13 22:22:21 -0700 |
commit | 1cdd2d52fce3c8689b0357c424bf77a3e72625d4 (patch) | |
tree | f8943623665f9989c70b9d602b311f006cde4c2a /power | |
parent | d6b0a1cc8809aba441f03c2090c142cfd227ce7d (diff) | |
download | chrome-ec-1cdd2d52fce3c8689b0357c424bf77a3e72625d4.tar.gz |
power: common: uint64divmod() for host_command_hibernation_delay()
This change is implemented so we won't need the 64 bit division
for nds32 core(__udivdi3).
Please have a look at CL:314400.
Signed-off-by: Dino Li <dino.li@ite.com.tw>
BRANCH=none
BUG=none
TEST=Issue the host command by "ectool hibdelay xx" and check if
hibernation delay was updated.
Change-Id: Ia2f08381e464563d954a6bf5998688cd9298fd38
Reviewed-on: https://chromium-review.googlesource.com/384436
Commit-Ready: Dino Li <Dino.Li@ite.com.tw>
Tested-by: Dino Li <Dino.Li@ite.com.tw>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'power')
-rw-r--r-- | power/common.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/power/common.c b/power/common.c index b0d474831d..5ec09d72a9 100644 --- a/power/common.c +++ b/power/common.c @@ -652,8 +652,11 @@ static int host_command_hibernation_delay(struct host_cmd_handler_args *args) const struct ec_params_hibernation_delay *p = args->params; struct ec_response_hibernation_delay *r = args->response; - uint32_t time_g3 = (uint32_t)((get_time().val - last_shutdown_time) - / SECOND); + uint32_t time_g3; + uint64_t t = get_time().val - last_shutdown_time; + + uint64divmod(&t, SECOND); + time_g3 = (uint32_t)t; /* Only change the hibernation delay if seconds is non-zero. */ if (p->seconds) |