diff --git a/[refs] b/[refs] index 5a68ee521961..44369f2f7df6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e48af19f56eb47a1f908ee8f16df9d246f955b21 +refs/heads/master: 38332cb98772f5ea757e6486bed7ed0381cb5f98 diff --git a/trunk/include/linux/time.h b/trunk/include/linux/time.h index 2091a19f1655..d32ef0ad4c0a 100644 --- a/trunk/include/linux/time.h +++ b/trunk/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++; }