aboutsummaryrefslogtreecommitdiff
path: root/kernel/time.c
diff options
context:
space:
mode:
authorJohn Stultz <johnstul@us.ibm.com>2010-03-11 14:04:47 -0800
committerThomas Gleixner <tglx@linutronix.de>2010-03-12 22:40:42 +0100
commit64ce4c2f5252f25798117fa80a027993163d6d84 (patch)
tree31aa86362e27a9a83958cf789ed31d4e674aa5ff /kernel/time.c
parentc28739375bf0d6e239b4fa939ec8372aa2c707d2 (diff)
time: Clean up warp_clock()
warp_clock() currently accesses timekeeping internal state directly, which is unnecessary. Convert it to use the proper timekeeping interfaces. Signed-off-by: John Stultz <johnstul@us.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/time.c')
-rw-r--r--kernel/time.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/time.c b/kernel/time.c
index 804798005d1..2358a3646a6 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -133,12 +133,11 @@ SYSCALL_DEFINE2(gettimeofday, struct timeval __user *, tv,
*/
static inline void warp_clock(void)
{
- write_seqlock_irq(&xtime_lock);
- wall_to_monotonic.tv_sec -= sys_tz.tz_minuteswest * 60;
- xtime.tv_sec += sys_tz.tz_minuteswest * 60;
- update_xtime_cache(0);
- write_sequnlock_irq(&xtime_lock);
- clock_was_set();
+ struct timespec delta, adjust;
+ delta.tv_sec = sys_tz.tz_minuteswest * 60;
+ delta.tv_nsec = 0;
+ adjust = timespec_add_safe(current_kernel_time(), delta);
+ do_settimeofday(&adjust);
}
/*