diff options
author | Arnd Bergmann <arnd@arndb.de> | 2015-09-28 16:21:29 -0400 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2015-10-01 12:59:01 -0400 |
commit | 071eee45b1650d53d21c636d344bdcebd4577ed2 (patch) | |
tree | 3e22cf4327f43092c26e2eb11236379ec7320f2f /include/linux/pps_kernel.h | |
parent | 7ec88e4be461590b5a3817460c34603f76d9b3ae (diff) |
ntp/pps: replace getnstime_raw_and_real with 64-bit version
There is exactly one caller of getnstime_raw_and_real in the kernel,
which is the pps_get_ts function. This changes the caller and
the implementation to work on timespec64 types rather than timespec,
to avoid the time_t overflow on 32-bit architectures.
For consistency with the other new functions (ktime_get_seconds,
ktime_get_real_*, ...), I'm renaming the function to
ktime_get_raw_and_real_ts64.
We still need to convert from the internal 64-bit type to 32 bit
types in the caller, but this conversion is now pushed out from
getnstime_raw_and_real to pps_get_ts. A follow-up patch changes
the remaining pps code to completely avoid the conversion.
Acked-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'include/linux/pps_kernel.h')
-rw-r--r-- | include/linux/pps_kernel.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h index 1d2cd21242e8..b2fbd62ab18d 100644 --- a/include/linux/pps_kernel.h +++ b/include/linux/pps_kernel.h | |||
@@ -115,7 +115,12 @@ static inline void timespec_to_pps_ktime(struct pps_ktime *kt, | |||
115 | 115 | ||
116 | static inline void pps_get_ts(struct pps_event_time *ts) | 116 | static inline void pps_get_ts(struct pps_event_time *ts) |
117 | { | 117 | { |
118 | getnstime_raw_and_real(&ts->ts_raw, &ts->ts_real); | 118 | struct timespec64 raw, real; |
119 | |||
120 | ktime_get_raw_and_real_ts64(&raw, &real); | ||
121 | |||
122 | ts->ts_raw = timespec64_to_timespec(raw); | ||
123 | ts->ts_real = timespec64_to_timespec(real); | ||
119 | } | 124 | } |
120 | 125 | ||
121 | #else /* CONFIG_NTP_PPS */ | 126 | #else /* CONFIG_NTP_PPS */ |