Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

firewire: use 64-bit time_t based interfaces

32-bit CLOCK_REALTIME timestamps overflow in year 2038, so all such
interfaces are deprecated now. For the FW_CDEV_IOC_GET_CYCLE_TIMER2
ioctl, we already support 64-bit timestamps, but the implementation
still uses timespec.

This changes the code to use timespec64 instead with the appropriate
accessor functions.

Link: http://lkml.kernel.org/r/20180711124456.1023039-1-arnd@arndb.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Arnd Bergmann and committed by
Linus Torvalds
2c1bb29a e1fb4a08

+4 -4
+4 -4
drivers/firewire/core-cdev.c
··· 1205 1205 { 1206 1206 struct fw_cdev_get_cycle_timer2 *a = &arg->get_cycle_timer2; 1207 1207 struct fw_card *card = client->device->card; 1208 - struct timespec ts = {0, 0}; 1208 + struct timespec64 ts = {0, 0}; 1209 1209 u32 cycle_time; 1210 1210 int ret = 0; 1211 1211 ··· 1214 1214 cycle_time = card->driver->read_csr(card, CSR_CYCLE_TIME); 1215 1215 1216 1216 switch (a->clk_id) { 1217 - case CLOCK_REALTIME: getnstimeofday(&ts); break; 1218 - case CLOCK_MONOTONIC: ktime_get_ts(&ts); break; 1219 - case CLOCK_MONOTONIC_RAW: getrawmonotonic(&ts); break; 1217 + case CLOCK_REALTIME: ktime_get_real_ts64(&ts); break; 1218 + case CLOCK_MONOTONIC: ktime_get_ts64(&ts); break; 1219 + case CLOCK_MONOTONIC_RAW: ktime_get_raw_ts64(&ts); break; 1220 1220 default: 1221 1221 ret = -EINVAL; 1222 1222 }