aboutsummaryrefslogtreecommitdiff
path: root/include/linux/time.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-03-09 10:06:49 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-03-09 10:06:49 -0700
commitbf5a25e1fff88a1066e20cc7263329405e4939f6 (patch)
tree95822dc50801e21cf1ad1e6aa7b58af898156517 /include/linux/time.h
parent83f7a2c118833d3738b4d162ea3c17d0bd8ffa94 (diff)
parent10a398d04c4a1fc395840f4d040493375f562302 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-hrt
* git://git.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-hrt: time: remove obsolete CLOCK_TICK_ADJUST time: don't touch an offlined CPU's ts->tick_stopped in tick_cancel_sched_timer() time: prevent the loop in timespec_add_ns() from being optimised away ntp: use unsigned input for do_div()
Diffstat (limited to 'include/linux/time.h')
-rw-r--r--include/linux/time.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/time.h b/include/linux/time.h
index 2091a19f165..d32ef0ad4c0 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -174,6 +174,10 @@ static inline void timespec_add_ns(struct timespec *a, u64 ns)
{
ns += a->tv_nsec;
while(unlikely(ns >= NSEC_PER_SEC)) {
+ /* The following asm() prevents the compiler from
+ * optimising this loop into a modulo operation. */
+ asm("" : "+r"(ns));
+
ns -= NSEC_PER_SEC;
a->tv_sec++;
}