summaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-07-16 21:04:19 +0000
committerJohn Stultz <john.stultz@linaro.org>2014-07-23 10:18:00 -0700
commita37c0aad6093575b52432b47b145304f1af18dff (patch)
tree2e180a8cb77d6b4c9c223cf58e64179c624dc44a /kernel/time
parentafab07c0e91ecf098abf34573ccfcd86d6be26f9 (diff)
downloadop-kernel-dev-a37c0aad6093575b52432b47b145304f1af18dff.zip
op-kernel-dev-a37c0aad6093575b52432b47b145304f1af18dff.tar.gz
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>
Diffstat (limited to 'kernel/time')
-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 c083ae2..54d9052 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,
ktime_t *offs_tai)
{
struct timekeeper *tk = &tk_core.timekeeper;
- ktime_t now;
unsigned int seq;
- u64 secs, nsecs;
+ ktime_t base;
+ u64 nsecs;
do {
seq = read_seqcount_begin(&tk_core.seq);
- secs = tk->xtime_sec;
+ base = tk->base_mono;
nsecs = timekeeping_get_ns(tk);
*offs_real = tk->offs_real;
@@ -1683,9 +1683,7 @@ ktime_t ktime_get_update_offsets_now(ktime_t *offs_real, ktime_t *offs_boot,
*offs_tai = tk->offs_tai;
} while (read_seqcount_retry(&tk_core.seq, seq));
- now = ktime_add_ns(ktime_set(secs, 0), nsecs);
- now = ktime_sub(now, *offs_real);
- return now;
+ return ktime_add_ns(base, nsecs);
}
#endif
OpenPOWER on IntegriCloud