summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2015-01-13 16:56:38 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-01-30 03:28:03 +0000
commitc47e3aeef60e45911b55c6d8611beec46ad156e7 (patch)
tree75588f644c8d58b74d12d29847f7429e4d7902ba
parent862145dd758f1d45465232e39e6b00c111444e28 (diff)
downloadchrome-ec-c47e3aeef60e45911b55c6d8611beec46ad156e7.tar.gz
stm32: remove useless modulo
The RTC delay is always less than a day (see the assert at the beginning of set_rtc_alarm), so remove the useless module to save a few bytes of flash. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=samus BUG=none TEST=make buildall and see the zinger firmware is smaller by 16 bytes (more than the 8 bytes I need to submit the following CL) Original-Change-Id: If0374ff5897f13e69574018d2123428075b2264e Reviewed-on: https://chromium-review.googlesource.com/240564 Reviewed-by: Alec Berg <alecaberg@chromium.org> Trybot-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit 34f927724f22d79c8e4c752189dc19b7fd4f7735) Reviewed-on: https://chromium-review.googlesource.com/240834 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit d1daa2b3d96df27b53da7aeef5dabf8ebb877aec) Signed-off-by: Todd Broch <tbroch@chromium.org> Change-Id: Ib353cecd829ff787f4eeee9ef407757107630ef4 Reviewed-on: https://chromium-review.googlesource.com/244169 Reviewed-by: Alec Berg <alecaberg@chromium.org> Tested-by: Todd Broch <tbroch@chromium.org> Commit-Queue: Todd Broch <tbroch@chromium.org>
-rw-r--r--chip/stm32/clock-stm32f0.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/chip/stm32/clock-stm32f0.c b/chip/stm32/clock-stm32f0.c
index 30a0efdf2b..74534eee3a 100644
--- a/chip/stm32/clock-stm32f0.c
+++ b/chip/stm32/clock-stm32f0.c
@@ -156,7 +156,7 @@ void set_rtc_alarm(uint32_t delay_s, uint32_t delay_us,
/* Calculate alarm time */
alarm_sec = rtc_to_sec(*rtc) + delay_s;
alarm_us = (RTC_PREDIV_S - *rtcss) * US_PER_RTC_TICK + delay_us;
- alarm_sec = (alarm_sec + alarm_us / SECOND) % 86400;
+ alarm_sec = alarm_sec + alarm_us / SECOND;
alarm_us = alarm_us % 1000000;
/* Set alarm time */