summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Chen <philipchen@google.com>2018-05-21 18:08:15 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-05-22 21:57:11 -0700
commit4ec57f14091c42e2f9502d1c17146a06fa105a88 (patch)
tree3ecbd5818ade852f8f2abc6ac60f80769722e030
parent038e75cd855fdbc63aebed53270e51bf6169b052 (diff)
downloadchrome-ec-4ec57f14091c42e2f9502d1c17146a06fa105a88.tar.gz
chip/stm32/clock: Initialize 'alarm_us'
The new GCC build shows a warning/error in clock-f.c: 'alarm_us' may be used uninitialized in this function [-Werror=maybe-uninitialized] This is actually a fake warning. In the context of the logic, there is no way 'alarm_us' would be used uninitialized. But let's still initialize 'alarm_us' to clear the compiler warning. BUG=none BRANCH=scarlet TEST='USE=coreboot-sdk emerge-scarlet chromeos-ec' TEST=make buildall -j Change-Id: I7a0642cbe03c5a0adb6997ddc80c9cb797715749 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/1068256 Commit-Ready: Martin Roth <martinroth@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org> Reviewed-by: Martin Roth <martinroth@chromium.org>
-rw-r--r--chip/stm32/clock-f.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/chip/stm32/clock-f.c b/chip/stm32/clock-f.c
index 4b94c1f655..ee1c28dbb2 100644
--- a/chip/stm32/clock-f.c
+++ b/chip/stm32/clock-f.c
@@ -165,7 +165,8 @@ void rtc_read(struct rtc_time_reg *rtc)
void set_rtc_alarm(uint32_t delay_s, uint32_t delay_us,
struct rtc_time_reg *rtc)
{
- uint32_t alarm_sec, alarm_us;
+ uint32_t alarm_sec = 0;
+ uint32_t alarm_us = 0;
if (delay_s == EC_RTC_ALARM_CLEAR && !delay_us) {
reset_rtc_alarm(rtc);