From: Uwe Kleine-König Date: Wed, 11 May 2016 07:11:23 +0000 (+0200) Subject: rtc: initialize output parameter for read alarm to "uninitialized" X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d68778b80dd78ad6ed998397af182163d0ef16b0;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git rtc: initialize output parameter for read alarm to "uninitialized" rtc drivers are supposed to set values they don't support to -1. To simplify this for drivers and also make it harder for them to get it wrong initialize the values to -1. Signed-off-by: Uwe Kleine-König Signed-off-by: Alexandre Belloni --- diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index 9ef5f6f89f98..99475908e556 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c @@ -104,7 +104,17 @@ static int rtc_read_alarm_internal(struct rtc_device *rtc, struct rtc_wkalrm *al else if (!rtc->ops->read_alarm) err = -EINVAL; else { - memset(alarm, 0, sizeof(struct rtc_wkalrm)); + alarm->enabled = 0; + alarm->pending = 0; + alarm->time.tm_sec = -1; + alarm->time.tm_min = -1; + alarm->time.tm_hour = -1; + alarm->time.tm_mday = -1; + alarm->time.tm_mon = -1; + alarm->time.tm_year = -1; + alarm->time.tm_wday = -1; + alarm->time.tm_yday = -1; + alarm->time.tm_isdst = -1; err = rtc->ops->read_alarm(rtc->dev.parent, alarm); }