From: Karel Zak Date: Mon, 14 Dec 2020 14:56:55 +0000 (+0100) Subject: hwclock: fix compiler warnings [-Wmaybe-uninitialized] X-Git-Tag: v2.37-rc1~220 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf8c19173845ca653f89dc7acb56d68c002788c1;p=thirdparty%2Futil-linux.git hwclock: fix compiler warnings [-Wmaybe-uninitialized] sys-utils/hwclock-rtc.c: In function 'synchronize_to_clock_tick_rtc': sys-utils/hwclock.c:169:28: warning: 'now.tv_usec' may be used uninitialized in this function [-Wmaybe-uninitialized] sys-utils/hwclock-rtc.c:215:24: note: 'now.tv_usec' was declared here sys-utils/hwclock.c:168:28: warning: 'now.tv_sec' may be used uninitialized in this function [-Wmaybe-uninitialized] sys-utils/hwclock-rtc.c:215:24: note: 'now.tv_sec' was declared here sys-utils/hwclock.c:169:28: warning: 'begin.tv_usec' may be used uninitialized in this function [-Wmaybe-uninitialized] sys-utils/hwclock-rtc.c:215:17: note: 'begin.tv_usec' was declared here sys-utils/hwclock.c:168:28: warning: 'begin.tv_sec' may be used uninitialized in this function [-Wmaybe-uninitialized] sys-utils/hwclock-rtc.c:215:17: note: 'begin.tv_sec' was declared here Signed-off-by: Karel Zak --- diff --git a/sys-utils/hwclock-rtc.c b/sys-utils/hwclock-rtc.c index fb94868481..163f04e7a5 100644 --- a/sys-utils/hwclock-rtc.c +++ b/sys-utils/hwclock-rtc.c @@ -212,7 +212,7 @@ static int busywait_for_rtc_clock_tick(const struct hwclock_control *ctl, /* The time when we were called (and started waiting) */ struct tm nowtime; int rc; - struct timeval begin, now; + struct timeval begin = { 0 }, now = { 0 }; if (ctl->verbose) { printf("ioctl(%d, RTC_UIE_ON, 0): %s\n",