diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-04-23 10:36:41 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-06-03 12:43:34 +0200 |
commit | 5235afa89a246c9d5ab35996bc38681c474c3ed7 (patch) | |
tree | 63504f5f9900aabca30cb26005248ceb85cf198b /arch/powerpc/kernel/time.c | |
parent | powerpc: use time64_t in read_persistent_clock (diff) | |
download | linux-5235afa89a246c9d5ab35996bc38681c474c3ed7.tar.xz linux-5235afa89a246c9d5ab35996bc38681c474c3ed7.zip |
powerpc: use time64_t in update_persistent_clock
update_persistent_clock() is deprecated because it suffers from overflow
in 2038 on 32-bit architectures. This changes powerpc to use the
update_persistent_clock64() replacement, and to pass down 64-bit
timestamps consistently.
This is now simpler, as we no longer have to worry about the offset
numbers in tm_year and tm_mon that are different between the Linux
conventions and RTAS.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/time.c')
-rw-r--r-- | arch/powerpc/kernel/time.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index da06a4d84ae2..b025acb32bfe 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -811,16 +811,14 @@ void __init generic_calibrate_decr(void) } } -int update_persistent_clock(struct timespec now) +int update_persistent_clock64(struct timespec64 now) { struct rtc_time tm; if (!ppc_md.set_rtc_time) return -ENODEV; - to_tm(now.tv_sec + 1 + timezone_offset, &tm); - tm.tm_year -= 1900; - tm.tm_mon -= 1; + rtc_time64_to_tm(now.tv_sec + 1 + timezone_offset, &tm); return ppc_md.set_rtc_time(&tm); } |