aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-07-16 17:04:19 -0400
committerJohn Stultz <john.stultz@linaro.org>2014-07-23 13:18:00 -0400
commita37c0aad6093575b52432b47b145304f1af18dff (patch)
tree2e180a8cb77d6b4c9c223cf58e64179c624dc44a
parentafab07c0e91ecf098abf34573ccfcd86d6be26f9 (diff)
timekeeping: Use ktime_t data for ktime_get_update_offsets_now()
No need to juggle with timespecs. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r--kernel/time/timekeeping.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index c083ae2c34b5..54d90529f99d 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1668,14 +1668,14 @@ ktime_t ktime_get_update_offsets_now(ktime_t *offs_real, ktime_t *offs_boot,
1668 ktime_t *offs_tai) 1668 ktime_t *offs_tai)
1669{ 1669{
1670 struct timekeeper *tk = &tk_core.timekeeper; 1670 struct timekeeper *tk = &tk_core.timekeeper;
1671 ktime_t now;
1672 unsigned int seq; 1671 unsigned int seq;
1673 u64 secs, nsecs; 1672 ktime_t base;
1673 u64 nsecs;
1674 1674
1675 do { 1675 do {
1676 seq = read_seqcount_begin(&tk_core.seq); 1676 seq = read_seqcount_begin(&tk_core.seq);
1677 1677
1678 secs = tk->xtime_sec; 1678 base = tk->base_mono;
1679 nsecs = timekeeping_get_ns(tk); 1679 nsecs = timekeeping_get_ns(tk);
1680 1680
1681 *offs_real = tk->offs_real; 1681 *offs_real = tk->offs_real;
@@ -1683,9 +1683,7 @@ ktime_t ktime_get_update_offsets_now(ktime_t *offs_real, ktime_t *offs_boot,
1683 *offs_tai = tk->offs_tai; 1683 *offs_tai = tk->offs_tai;
1684 } while (read_seqcount_retry(&tk_core.seq, seq)); 1684 } while (read_seqcount_retry(&tk_core.seq, seq));
1685 1685
1686 now = ktime_add_ns(ktime_set(secs, 0), nsecs); 1686 return ktime_add_ns(base, nsecs);
1687 now = ktime_sub(now, *offs_real);
1688 return now;
1689} 1687}
1690#endif 1688#endif
1691 1689