PM / sleep: switch to rtc_time64_to_tm/rtc_tm_to_time64
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- kernel/power/suspend_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/power/suspend_test.c +3 -3
@@ -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 @@ static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state)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);
Signature · 1 line
2.23.0
Quoted 24 lines · CET Alexandre Belloni
Call the 64bit versions of
rtc_tmtime conversion to avoid the y2038 issue.Signed-off-by Alexandre Belloni <[email protected]>--- kernel/power/suspend_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)kernel/power/suspend_test.c +1
-1@@ -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 @@ static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state)printk (err_readtime,dev_name (&rtc->dev), status);return ;
kernel/power/suspend_test.c static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state) · line 90
Quoted 10 lines
kernel/power/suspend_test.c +2
-2} -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);
Applied (with a slightly modified changelog) as 5.6 material, thanks!