summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2019-12-10 18:05:40 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-12-20 09:58:08 +0100
commit2a2ef473cc9111b0d21ce18f49cb34d93d6991ad (patch)
treeaed0fd1623eebf4074b74aa56089a33d4554a5a7
parentd1eef1c619749b2a57e514a3fa67d9a516ffa919 (diff)
downloadlinux-2a2ef473cc9111b0d21ce18f49cb34d93d6991ad.tar.gz
linux-2a2ef473cc9111b0d21ce18f49cb34d93d6991ad.tar.bz2
linux-2a2ef473cc9111b0d21ce18f49cb34d93d6991ad.zip
PM: sleep: Switch to rtc_time64_to_tm()/rtc_tm_to_time64()
Call the 64bit versions of rtc_tm time conversion to avoid the y2038 issue. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--kernel/power/suspend_test.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/power/suspend_test.c b/kernel/power/suspend_test.c
index 60564b58de07..e1ed58adb69e 100644
--- a/kernel/power/suspend_test.c
+++ b/kernel/power/suspend_test.c
@@ -70,7 +70,7 @@ static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state)
static char info_test[] __initdata =
KERN_INFO "PM: test RTC wakeup from '%s' suspend\n";
- unsigned long now;
+ time64_t now;
struct rtc_wkalrm alm;
int status;
@@ -81,10 +81,10 @@ repeat:
printk(err_readtime, dev_name(&rtc->dev), status);
return;
}
- rtc_tm_to_time(&alm.time, &now);
+ now = rtc_tm_to_time64(&alm.time);
memset(&alm, 0, sizeof alm);
- rtc_time_to_tm(now + TEST_SUSPEND_SECONDS, &alm.time);
+ rtc_time64_to_tm(now + TEST_SUSPEND_SECONDS, &alm.time);
alm.enabled = true;
status = rtc_set_alarm(rtc, &alm);