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>
This commit is contained in:

committed by
Michael Ellerman

parent
5bfd643583
commit
5235afa89a
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user