提交 a37c0aad 编写于 作者: T Thomas Gleixner 提交者: John Stultz

timekeeping: Use ktime_t data for ktime_get_update_offsets_now()

No need to juggle with timespecs.
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
上级 afab07c0
...@@ -1668,14 +1668,14 @@ ktime_t ktime_get_update_offsets_now(ktime_t *offs_real, ktime_t *offs_boot, ...@@ -1668,14 +1668,14 @@ ktime_t ktime_get_update_offsets_now(ktime_t *offs_real, ktime_t *offs_boot,
ktime_t *offs_tai) ktime_t *offs_tai)
{ {
struct timekeeper *tk = &tk_core.timekeeper; struct timekeeper *tk = &tk_core.timekeeper;
ktime_t now;
unsigned int seq; unsigned int seq;
u64 secs, nsecs; ktime_t base;
u64 nsecs;
do { do {
seq = read_seqcount_begin(&tk_core.seq); seq = read_seqcount_begin(&tk_core.seq);
secs = tk->xtime_sec; base = tk->base_mono;
nsecs = timekeeping_get_ns(tk); nsecs = timekeeping_get_ns(tk);
*offs_real = tk->offs_real; *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,9 +1683,7 @@ ktime_t ktime_get_update_offsets_now(ktime_t *offs_real, ktime_t *offs_boot,
*offs_tai = tk->offs_tai; *offs_tai = tk->offs_tai;
} while (read_seqcount_retry(&tk_core.seq, seq)); } while (read_seqcount_retry(&tk_core.seq, seq));
now = ktime_add_ns(ktime_set(secs, 0), nsecs); return ktime_add_ns(base, nsecs);
now = ktime_sub(now, *offs_real);
return now;
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册