diff options
author | Anna-Maria Gleixner <anna-maria@linutronix.de> | 2017-12-21 05:41:53 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-01-15 21:00:43 -0500 |
commit | ad38f596d8e4babc19be8b21a7a49debffb4a7f5 (patch) | |
tree | 20c0d2b2585295168e1ac0a2a0aabfb893fc27cf | |
parent | 138a6b7ae4dedde5513678f57b275eee19c41b6a (diff) |
hrtimer: Factor out __hrtimer_next_event_base()
Preparatory patch for softirq based hrtimers to avoid code duplication.
No functional change.
Signed-off-by: Anna-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: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | kernel/time/hrtimer.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 4142e6f536b4..5d9b81d224b3 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c | |||
@@ -458,13 +458,13 @@ __next_base(struct hrtimer_cpu_base *cpu_base, unsigned int *active) | |||
458 | #define for_each_active_base(base, cpu_base, active) \ | 458 | #define for_each_active_base(base, cpu_base, active) \ |
459 | while ((base = __next_base((cpu_base), &(active)))) | 459 | while ((base = __next_base((cpu_base), &(active)))) |
460 | 460 | ||
461 | static ktime_t __hrtimer_get_next_event(struct hrtimer_cpu_base *cpu_base) | 461 | static ktime_t __hrtimer_next_event_base(struct hrtimer_cpu_base *cpu_base, |
462 | unsigned int active, | ||
463 | ktime_t expires_next) | ||
462 | { | 464 | { |
463 | struct hrtimer_clock_base *base; | 465 | struct hrtimer_clock_base *base; |
464 | unsigned int active = cpu_base->active_bases; | 466 | ktime_t expires; |
465 | ktime_t expires, expires_next = KTIME_MAX; | ||
466 | 467 | ||
467 | cpu_base->next_timer = NULL; | ||
468 | for_each_active_base(base, cpu_base, active) { | 468 | for_each_active_base(base, cpu_base, active) { |
469 | struct timerqueue_node *next; | 469 | struct timerqueue_node *next; |
470 | struct hrtimer *timer; | 470 | struct hrtimer *timer; |
@@ -487,6 +487,18 @@ static ktime_t __hrtimer_get_next_event(struct hrtimer_cpu_base *cpu_base) | |||
487 | return expires_next; | 487 | return expires_next; |
488 | } | 488 | } |
489 | 489 | ||
490 | static ktime_t __hrtimer_get_next_event(struct hrtimer_cpu_base *cpu_base) | ||
491 | { | ||
492 | unsigned int active = cpu_base->active_bases; | ||
493 | ktime_t expires_next = KTIME_MAX; | ||
494 | |||
495 | cpu_base->next_timer = NULL; | ||
496 | |||
497 | expires_next = __hrtimer_next_event_base(cpu_base, active, expires_next); | ||
498 | |||
499 | return expires_next; | ||
500 | } | ||
501 | |||
490 | static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base) | 502 | static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base) |
491 | { | 503 | { |
492 | ktime_t *offs_real = &base->clock_base[HRTIMER_BASE_REALTIME].offset; | 504 | ktime_t *offs_real = &base->clock_base[HRTIMER_BASE_REALTIME].offset; |