powerpc: rtas: clean up time handling
authorArnd Bergmann <arnd@arndb.de>
Mon, 23 Apr 2018 08:36:39 +0000 (10:36 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 3 Jun 2018 10:43:33 +0000 (20:43 +1000)
commit2dc20f454dcf82c52ed41362ce0b3140ce8ad4be
tree40523497985dcb67622fa416ad77d0ced6bcfaac
parent6e8cef384a41882b2d4ec6992dd0d74246b3f353
powerpc: rtas: clean up time handling

The to_tm() helper function operates on a signed integer for the time,
so it will suffer from overflow in 2038, even on 64-bit kernels.

Rather than fix that function, this replaces its use in the rtas
procfs implementation with the standard rtc_time64_to_tm() helper
that is very similar but is not affected by the overflow.

In order to actually support long times, the parser function gets
changed to 64-bit user input and output as well. Note that the tm_mon
and tm_year representation is slightly different, so we have to manually
add an offset here.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/rtas-proc.c