aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pps
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2015-09-28 16:21:31 -0400
committerJohn Stultz <john.stultz@linaro.org>2015-10-01 12:59:16 -0400
commitade1bdffe90e59cd257cb9bd4f5abe4de5f14911 (patch)
tree5ad7a6da9470e70915ea5d1640a5bd665ef2957b /drivers/pps
parent5fd96c421ff2c76ec441aa4139c3b87dfea93e3a (diff)
ntp/pps: use y2038 safe types in pps_event_time
The pps_event_time uses two 'timespec' structures internally, which suffer from the y2038 problem. The uses of this structure are fairly self-contained in the pps code, so this replaces them all at once. Unfortunately, this includes the sfc ethernet driver aside from the pps subsystem, so we change that one as well. Both touch the same data structure, and there probably is no good way to split the patch into smaller units. 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 'drivers/pps')
-rw-r--r--drivers/pps/kapi.c4
-rw-r--r--drivers/pps/kc.c4
2 files changed, 3 insertions, 5 deletions
diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c
index cdad4d95b20e..805c749ac1ad 100644
--- a/drivers/pps/kapi.c
+++ b/drivers/pps/kapi.c
@@ -179,8 +179,8 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event,
179 /* check event type */ 179 /* check event type */
180 BUG_ON((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0); 180 BUG_ON((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0);
181 181
182 dev_dbg(pps->dev, "PPS event at %ld.%09ld\n", 182 dev_dbg(pps->dev, "PPS event at %lld.%09ld\n",
183 ts->ts_real.tv_sec, ts->ts_real.tv_nsec); 183 (s64)ts->ts_real.tv_sec, ts->ts_real.tv_nsec);
184 184
185 timespec_to_pps_ktime(&ts_real, ts->ts_real); 185 timespec_to_pps_ktime(&ts_real, ts->ts_real);
186 186
diff --git a/drivers/pps/kc.c b/drivers/pps/kc.c
index a16cea2ba980..e219db1f1c84 100644
--- a/drivers/pps/kc.c
+++ b/drivers/pps/kc.c
@@ -113,12 +113,10 @@ void pps_kc_event(struct pps_device *pps, struct pps_event_time *ts,
113 int event) 113 int event)
114{ 114{
115 unsigned long flags; 115 unsigned long flags;
116 struct timespec64 real = timespec_to_timespec64(ts->ts_real);
117 struct timespec64 raw = timespec_to_timespec64(ts->ts_raw);
118 116
119 /* Pass some events to kernel consumer if activated */ 117 /* Pass some events to kernel consumer if activated */
120 spin_lock_irqsave(&pps_kc_hardpps_lock, flags); 118 spin_lock_irqsave(&pps_kc_hardpps_lock, flags);
121 if (pps == pps_kc_hardpps_dev && event & pps_kc_hardpps_mode) 119 if (pps == pps_kc_hardpps_dev && event & pps_kc_hardpps_mode)
122 hardpps(&real, &raw); 120 hardpps(&ts->ts_real, &ts->ts_raw);
123 spin_unlock_irqrestore(&pps_kc_hardpps_lock, flags); 121 spin_unlock_irqrestore(&pps_kc_hardpps_lock, flags);
124} 122}