rtc: Convert rtc_set_ntp_time() to use timespec64
authorXunlei Pang <pang.xunlei@linaro.org>
Thu, 22 Jan 2015 02:31:55 +0000 (02:31 +0000)
committerJohn Stultz <john.stultz@linaro.org>
Sat, 24 Jan 2015 01:21:57 +0000 (17:21 -0800)
rtc_set_ntp_time() uses timespec which is y2038-unsafe,
so modify to use timespec64 which is y2038-safe, then
replace rtc_time_to_tm() with rtc_time64_to_tm().

Also adjust all its call sites(only NTP uses it) accordingly.

Cc: pang.xunlei <pang.xunlei@linaro.org>
Cc: Arnd Bergmann <arnd.bergmann@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
drivers/rtc/systohc.c
include/linux/rtc.h
kernel/time/ntp.c

index bf3e242..eb71872 100644 (file)
  *
  * If temporary failure is indicated the caller should try again 'soon'
  */
-int rtc_set_ntp_time(struct timespec now)
+int rtc_set_ntp_time(struct timespec64 now)
 {
        struct rtc_device *rtc;
        struct rtc_time tm;
        int err = -ENODEV;
 
        if (now.tv_nsec < (NSEC_PER_SEC >> 1))
-               rtc_time_to_tm(now.tv_sec, &tm);
+               rtc_time64_to_tm(now.tv_sec, &tm);
        else
-               rtc_time_to_tm(now.tv_sec + 1, &tm);
+               rtc_time64_to_tm(now.tv_sec + 1, &tm);
 
        rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
        if (rtc) {
Simple merge
Simple merge