aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/timekeeping.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2013-02-21 17:51:36 -0500
committerJohn Stultz <john.stultz@linaro.org>2013-03-22 19:19:59 -0400
commit23a9537a6999fce16f06ca61fc6cac52c8fbdc86 (patch)
treedb1f5b82730a087bf36be7dc3ad46354a79877ea /kernel/time/timekeeping.c
parent90adda98b89aaf68b06014ecf805b6c477daa19b (diff)
timekeeping: Calc stuff once
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>
Diffstat (limited to 'kernel/time/timekeeping.c')
-rw-r--r--kernel/time/timekeeping.c7
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)
1250static cycle_t logarithmic_accumulation(struct timekeeper *tk, cycle_t offset, 1250static 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);