diff options
author | John Stultz <john.stultz@linaro.org> | 2013-03-22 14:20:03 -0700 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2013-04-04 13:18:16 -0700 |
commit | 0b5154fb9040cca94e7d9893384c0e78bfe2d296 (patch) | |
tree | 56f00530b6f99159d478ed48771a2fd97b26c5f1 /kernel/time/timekeeping.c | |
parent | 06c017fdd4dc48451a29ac37fc1db4a3f86b7f40 (diff) |
timekeeping: Simplify tai updating from do_adjtimex
Since we are taking the timekeeping locks, just go ahead
and update any tai change directly, rather then dropping
the lock and calling a function that will just take it again.
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/time/timekeeping.c')
-rw-r--r-- | kernel/time/timekeeping.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index d10bd734b15..f93f60cd97a 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1618,9 +1618,10 @@ EXPORT_SYMBOL_GPL(ktime_get_monotonic_offset); */ int do_adjtimex(struct timex *txc) { + struct timekeeper *tk = &timekeeper; unsigned long flags; struct timespec ts; - s32 tai, orig_tai; + s32 tai; int ret; /* Validate the data before disabling interrupts */ @@ -1640,19 +1641,17 @@ int do_adjtimex(struct timex *txc) } getnstimeofday(&ts); - orig_tai = tai = timekeeping_get_tai_offset(); raw_spin_lock_irqsave(&timekeeper_lock, flags); write_seqcount_begin(&timekeeper_seq); + tai = tk->tai_offset; ret = __do_adjtimex(txc, &ts, &tai); + __timekeeping_set_tai_offset(tk, tai); write_seqcount_end(&timekeeper_seq); raw_spin_unlock_irqrestore(&timekeeper_lock, flags); - if (tai != orig_tai) - timekeeping_set_tai_offset(tai); - return ret; } |