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

Commit ad38f596 authored by Anna-Maria Gleixner's avatar Anna-Maria Gleixner Committed by Ingo Molnar
Browse files

hrtimer: Factor out __hrtimer_next_event_base()



Preparatory patch for softirq based hrtimers to avoid code duplication.

No functional change.

Signed-off-by: default avatarAnna-Maria Gleixner <anna-maria@linutronix.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: keescook@chromium.org
Link: http://lkml.kernel.org/r/20171221104205.7269-25-anna-maria@linutronix.de


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 138a6b7a
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -458,13 +458,13 @@ __next_base(struct hrtimer_cpu_base *cpu_base, unsigned int *active)
#define for_each_active_base(base, cpu_base, active)	\
	while ((base = __next_base((cpu_base), &(active))))

static ktime_t __hrtimer_get_next_event(struct hrtimer_cpu_base *cpu_base)
static ktime_t __hrtimer_next_event_base(struct hrtimer_cpu_base *cpu_base,
					 unsigned int active,
					 ktime_t expires_next)
{
	struct hrtimer_clock_base *base;
	unsigned int active = cpu_base->active_bases;
	ktime_t expires, expires_next = KTIME_MAX;
	ktime_t expires;

	cpu_base->next_timer = NULL;
	for_each_active_base(base, cpu_base, active) {
		struct timerqueue_node *next;
		struct hrtimer *timer;
@@ -487,6 +487,18 @@ static ktime_t __hrtimer_get_next_event(struct hrtimer_cpu_base *cpu_base)
	return expires_next;
}

static ktime_t __hrtimer_get_next_event(struct hrtimer_cpu_base *cpu_base)
{
	unsigned int active = cpu_base->active_bases;
	ktime_t expires_next = KTIME_MAX;

	cpu_base->next_timer = NULL;

	expires_next = __hrtimer_next_event_base(cpu_base, active, expires_next);

	return expires_next;
}

static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base)
{
	ktime_t *offs_real = &base->clock_base[HRTIMER_BASE_REALTIME].offset;