summaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-06-19 16:02:28 +0200
committerGeert Uytterhoeven <geert@linux-m68k.org>2018-07-29 10:44:58 +0200
commit5b9bfb8ec467b2017f36d7675434822271ce3d29 (patch)
treebadd1ef812f661c2ca4801b79e35d936a79ff9fe /mm/shmem.c
parent9eb8be602bf8d550a33b4e1f9fac543bd5c89f4d (diff)
downloadtalos-obmc-linux-5b9bfb8ec467b2017f36d7675434822271ce3d29.tar.gz
talos-obmc-linux-5b9bfb8ec467b2017f36d7675434822271ce3d29.zip
m68k: mac: Use time64_t in RTC handling
The real-time clock on m68k (and powerpc) mac systems uses an unsigned 32-bit value starting in 1904, which overflows in 2040, about two years later than everyone else, but this gets wrapped around in the Linux code in 2038 already because of the deprecated usage of time_t and/or long in the conversion. Getting rid of the deprecated interfaces makes it work until 2040 as documented, and it could be easily extended by reinterpreting the resulting time64_t as a positive number. For the moment, I'm adding a WARN_ON() that triggers if we encounter a time before 1970 or after 2040 (the two are indistinguishable). This brings it in line with the corresponding code that we have on powerpc macintosh. Signed-off-by: Arnd Bergmann <arnd@arndb.de> [fthain: Adopt __u32 for the union in via_read_time(), consistent with changes to via_write_time()] [fthain: Use lower_32_bits() in via_write_time(), consistent with changes to pmu_write_time() and cuda_write_time()] [fthain: Have via_read_time() return a time64_t, consistent with changes to pmu_read_time() and cuda_read_time()] [fthain: Drop the pointless wraparound conditional in via_read_time()] Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Reviewed-by: Arnd Bergmann <arnd@arndb.de> [geert: Drop WARN_ON(), as it is reported to trigger on powermac] Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'mm/shmem.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud