From 34f927724f22d79c8e4c752189dc19b7fd4f7735 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Tue, 13 Jan 2015 16:56:38 -0800 Subject: [PATCH] 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 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) Change-Id: If0374ff5897f13e69574018d2123428075b2264e Reviewed-on: https://chromium-review.googlesource.com/240564 Reviewed-by: Alec Berg Trybot-Ready: Vincent Palatin Tested-by: Vincent Palatin Commit-Queue: Vincent Palatin --- chip/stm32/clock-stm32f0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */