lkml.org 
[lkml]   [2014]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 21/55] timekeeping; Use ktime based data for ktime_get_update_offsets_tick()
No need to juggle with timespecs.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/time/timekeeping.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

Index: tip/kernel/time/timekeeping.c
===================================================================
--- tip.orig/kernel/time/timekeeping.c
+++ tip/kernel/time/timekeeping.c
@@ -1640,22 +1640,22 @@ ktime_t ktime_get_update_offsets_tick(kt
ktime_t *offs_tai)
{
struct timekeeper *tk = &tk_core.timekeeper;
- struct timespec64 ts;
- ktime_t now;
unsigned int seq;
+ ktime_t base;
+ u64 nsecs;

do {
seq = read_seqcount_begin(&tk_core.seq);

- ts = tk_xtime(tk);
+ base = tk->base_mono;
+ nsecs = tk->xtime_nsec >> tk->shift;
+
*offs_real = tk->offs_real;
*offs_boot = tk->offs_boot;
*offs_tai = tk->offs_tai;
} while (read_seqcount_retry(&tk_core.seq, seq));

- now = ktime_set(ts.tv_sec, ts.tv_nsec);
- now = ktime_sub(now, *offs_real);
- return now;
+ return ktime_add_ns(base, nsecs);
}

#ifdef CONFIG_HIGH_RES_TIMERS



\
 
 \ /
  Last update: 2014-07-11 16:41    [W:0.496 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site