diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-09-16 15:48:45 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-09-16 15:48:45 -0400 |
commit | e5e7046b446c9e709701cec312f9de120d7f94ff (patch) | |
tree | f610acc8ba6b8424a1b1ec4ac5af8a022807438e | |
parent | 2847cec47d8812ffe320b4ceb7fe7ea40965efe1 (diff) | |
parent | cc4319890a80190d3290f1e04886d0384969b5f3 (diff) |
Merge branch 'master' into sched_trace
-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 b04136d60a..3e8fd9e57e 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -173,6 +173,10 @@ static inline void timespec_add_ns(struct timespec *a, u64 ns) | |||
173 | { | 173 | { |
174 | ns += a->tv_nsec; | 174 | ns += a->tv_nsec; |
175 | while(unlikely(ns >= NSEC_PER_SEC)) { | 175 | while(unlikely(ns >= NSEC_PER_SEC)) { |
176 | /* The following asm() prevents the compiler from | ||
177 | * optimising this loop into a modulo operation. */ | ||
178 | asm("" : "+r"(ns)); | ||
179 | |||
176 | ns -= NSEC_PER_SEC; | 180 | ns -= NSEC_PER_SEC; |
177 | a->tv_sec++; | 181 | a->tv_sec++; |
178 | } | 182 | } |