aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/timekeeping.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-12-25 05:38:40 -0500
committerThomas Gleixner <tglx@linutronix.de>2016-12-25 11:21:22 -0500
commit2456e855354415bfaeb7badaa14e11b3e02c8466 (patch)
tree6fc81500645174c246c3fdb568cba32aa01960c6 /kernel/time/timekeeping.c
parenta5a1d1c2914b5316924c7893eb683a5420ebd3be (diff)
ktime: Get rid of the union
ktime is a union because the initial implementation stored the time in scalar nanoseconds on 64 bit machine and in a endianess optimized timespec variant for 32bit machines. The Y2038 cleanup removed the timespec variant and switched everything to scalar nanoseconds. The union remained, but become completely pointless. Get rid of the union and just keep ktime_t as simple typedef of type s64. The conversion was done with coccinelle and some manual mopping up. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'kernel/time/timekeeping.c')
-rw-r--r--kernel/time/timekeeping.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index f4152a69277f..db087d7e106d 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -104,7 +104,7 @@ static void tk_set_wall_to_mono(struct timekeeper *tk, struct timespec64 wtm)
104 */ 104 */
105 set_normalized_timespec64(&tmp, -tk->wall_to_monotonic.tv_sec, 105 set_normalized_timespec64(&tmp, -tk->wall_to_monotonic.tv_sec,
106 -tk->wall_to_monotonic.tv_nsec); 106 -tk->wall_to_monotonic.tv_nsec);
107 WARN_ON_ONCE(tk->offs_real.tv64 != timespec64_to_ktime(tmp).tv64); 107 WARN_ON_ONCE(tk->offs_real != timespec64_to_ktime(tmp));
108 tk->wall_to_monotonic = wtm; 108 tk->wall_to_monotonic = wtm;
109 set_normalized_timespec64(&tmp, -wtm.tv_sec, -wtm.tv_nsec); 109 set_normalized_timespec64(&tmp, -wtm.tv_sec, -wtm.tv_nsec);
110 tk->offs_real = timespec64_to_ktime(tmp); 110 tk->offs_real = timespec64_to_ktime(tmp);
@@ -571,7 +571,7 @@ EXPORT_SYMBOL_GPL(pvclock_gtod_unregister_notifier);
571static inline void tk_update_leap_state(struct timekeeper *tk) 571static inline void tk_update_leap_state(struct timekeeper *tk)
572{ 572{
573 tk->next_leap_ktime = ntp_get_next_leap(); 573 tk->next_leap_ktime = ntp_get_next_leap();
574 if (tk->next_leap_ktime.tv64 != KTIME_MAX) 574 if (tk->next_leap_ktime != KTIME_MAX)
575 /* Convert to monotonic time */ 575 /* Convert to monotonic time */
576 tk->next_leap_ktime = ktime_sub(tk->next_leap_ktime, tk->offs_real); 576 tk->next_leap_ktime = ktime_sub(tk->next_leap_ktime, tk->offs_real);
577} 577}
@@ -2250,7 +2250,7 @@ ktime_t ktime_get_update_offsets_now(unsigned int *cwsseq, ktime_t *offs_real,
2250 } 2250 }
2251 2251
2252 /* Handle leapsecond insertion adjustments */ 2252 /* Handle leapsecond insertion adjustments */
2253 if (unlikely(base.tv64 >= tk->next_leap_ktime.tv64)) 2253 if (unlikely(base >= tk->next_leap_ktime))
2254 *offs_real = ktime_sub(tk->offs_real, ktime_set(1, 0)); 2254 *offs_real = ktime_sub(tk->offs_real, ktime_set(1, 0));
2255 2255
2256 } while (read_seqcount_retry(&tk_core.seq, seq)); 2256 } while (read_seqcount_retry(&tk_core.seq, seq));