diff options
-rw-r--r-- | kernel/time/timekeeping.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 8061ae0be7bd..c442a4ccccc9 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -1250,15 +1250,16 @@ static inline void accumulate_nsecs_to_secs(struct timekeeper *tk) | |||
1250 | static cycle_t logarithmic_accumulation(struct timekeeper *tk, cycle_t offset, | 1250 | static cycle_t logarithmic_accumulation(struct timekeeper *tk, cycle_t offset, |
1251 | u32 shift) | 1251 | u32 shift) |
1252 | { | 1252 | { |
1253 | cycle_t interval = tk->cycle_interval << shift; | ||
1253 | u64 raw_nsecs; | 1254 | u64 raw_nsecs; |
1254 | 1255 | ||
1255 | /* If the offset is smaller then a shifted interval, do nothing */ | 1256 | /* If the offset is smaller then a shifted interval, do nothing */ |
1256 | if (offset < tk->cycle_interval<<shift) | 1257 | if (offset < interval) |
1257 | return offset; | 1258 | return offset; |
1258 | 1259 | ||
1259 | /* Accumulate one shifted interval */ | 1260 | /* Accumulate one shifted interval */ |
1260 | offset -= tk->cycle_interval << shift; | 1261 | offset -= interval; |
1261 | tk->clock->cycle_last += tk->cycle_interval << shift; | 1262 | tk->clock->cycle_last += interval; |
1262 | 1263 | ||
1263 | tk->xtime_nsec += tk->xtime_interval << shift; | 1264 | tk->xtime_nsec += tk->xtime_interval << shift; |
1264 | accumulate_nsecs_to_secs(tk); | 1265 | accumulate_nsecs_to_secs(tk); |