mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
rtc: Convert rtc_set_ntp_time() to use timespec64
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 <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Signed-off-by: Xunlei Pang <[email protected]> Signed-off-by: John Stultz <[email protected]>
This commit is contained in:
parent
966301a23e
commit
9a4a445e30
3 changed files with 6 additions and 6 deletions
|
|
@ -20,16 +20,16 @@
|
|||
*
|
||||
* 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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue