diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-09 10:06:49 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-09 10:06:49 -0700 |
commit | bf5a25e1fff88a1066e20cc7263329405e4939f6 (patch) | |
tree | 95822dc50801e21cf1ad1e6aa7b58af898156517 /include/linux/time.h | |
parent | 83f7a2c118833d3738b4d162ea3c17d0bd8ffa94 (diff) | |
parent | 10a398d04c4a1fc395840f4d040493375f562302 (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.h | 4 |
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++; } |