Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23a9537a authored by Thomas Gleixner's avatar Thomas Gleixner Committed by John Stultz
Browse files

timekeeping: Calc stuff once



Calculate the cycle interval shifted value once. No functional change,
just makes the code more readable.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
parent 90adda98
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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);