Merge branch 'for-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
[cascardo/linux.git] / kernel / time / timekeeping.c
index 255e225..3b65746 100644 (file)
@@ -480,10 +480,12 @@ static inline void old_vsyscall_fixup(struct timekeeper *tk)
        * users are removed, this can be killed.
        */
        remainder = tk->tkr_mono.xtime_nsec & ((1ULL << tk->tkr_mono.shift) - 1);
-       tk->tkr_mono.xtime_nsec -= remainder;
-       tk->tkr_mono.xtime_nsec += 1ULL << tk->tkr_mono.shift;
-       tk->ntp_error += remainder << tk->ntp_error_shift;
-       tk->ntp_error -= (1ULL << tk->tkr_mono.shift) << tk->ntp_error_shift;
+       if (remainder != 0) {
+               tk->tkr_mono.xtime_nsec -= remainder;
+               tk->tkr_mono.xtime_nsec += 1ULL << tk->tkr_mono.shift;
+               tk->ntp_error += remainder << tk->ntp_error_shift;
+               tk->ntp_error -= (1ULL << tk->tkr_mono.shift) << tk->ntp_error_shift;
+       }
 }
 #else
 #define old_vsyscall_fixup(tk)