timekeeping: Calc stuff once
authorThomas Gleixner <tglx@linutronix.de>
Thu, 21 Feb 2013 22:51:36 +0000 (22:51 +0000)
committerJohn Stultz <john.stultz@linaro.org>
Fri, 22 Mar 2013 23:19:59 +0000 (16:19 -0700)
Calculate the cycle interval shifted value once. No functional change,
just makes the code more readable.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
kernel/time/timekeeping.c

index 8061ae0be7bd2b691071533937b66c6419eb6f85..c442a4ccccc990752321bfa3b3a04543c80e7b95 100644 (file)
@@ -1250,15 +1250,16 @@ static inline void accumulate_nsecs_to_secs(struct timekeeper *tk)
 static cycle_t logarithmic_accumulation(struct timekeeper *tk, cycle_t offset,
                                                u32 shift)
 {
+       cycle_t interval = tk->cycle_interval << shift;
        u64 raw_nsecs;
 
        /* If the offset is smaller then a shifted interval, do nothing */
-       if (offset < tk->cycle_interval<<shift)
+       if (offset < interval)
                return offset;
 
        /* Accumulate one shifted interval */
-       offset -= tk->cycle_interval << shift;
-       tk->clock->cycle_last += tk->cycle_interval << shift;
+       offset -= interval;
+       tk->clock->cycle_last += interval;
 
        tk->xtime_nsec += tk->xtime_interval << shift;
        accumulate_nsecs_to_secs(tk);