diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-06-21 08:22:51 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-06-21 08:22:51 +0200 |
commit | c7d6b5a22c00a19b513353469d89062264a7235f (patch) | |
tree | e693b4d3cd596471a2516529d6ef5c3ed9efcbdc /kernel/time/timekeeping.c | |
parent | 86721ab63b61ef1dd7305308e4049f644703decf (diff) | |
parent | 7c71feb0a6766c7c3a262e3cc33ae231f3953cb6 (diff) | |
download | linux-c7d6b5a22c00a19b513353469d89062264a7235f.tar.bz2 |
Merge branch 'fortglx/4.8/time' of https://git.linaro.org/people/john.stultz/linux into timers/core
Pull time(keeping) updates from John Stultz:
- Handle the 1ns issue with the old refusing to die vsyscall machinery
- More y2038 updates
- Documentation fixes
- Simplify clocksource handling
Diffstat (limited to 'kernel/time/timekeeping.c')
-rw-r--r-- | kernel/time/timekeeping.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 479d25cd3d4f..a196e08324e7 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -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) |