Skip to content

Commit

Permalink
timekeeping: Use ktime_t data for ktime_get_update_offsets_now()
Browse files Browse the repository at this point in the history
No need to juggle with timespecs.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: John Stultz <[email protected]>
  • Loading branch information
KAGA-KOKO authored and johnstultz-work committed Jul 23, 2014
1 parent afab07c commit a37c0aa
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions kernel/time/timekeeping.c
Original file line number Diff line number Diff line change
Expand Up @@ -1668,24 +1668,22 @@ 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;
*offs_boot = tk->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

Expand Down

0 comments on commit a37c0aa

Please sign in to comment.