From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751645AbeAPDxr (ORCPT + 1 other); Mon, 15 Jan 2018 22:53:47 -0500 Received: from terminus.zytor.com ([65.50.211.136]:34205 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751150AbeAPDxp (ORCPT ); Mon, 15 Jan 2018 22:53:45 -0500 Date: Mon, 15 Jan 2018 19:50:24 -0800 From: tip-bot for Anna-Maria Gleixner Message-ID: Cc: mingo@kernel.org, john.stultz@linaro.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, hpa@zytor.com, peterz@infradead.org, hch@lst.de, tglx@linutronix.de, anna-maria@linutronix.de Reply-To: hch@lst.de, peterz@infradead.org, anna-maria@linutronix.de, tglx@linutronix.de, john.stultz@linaro.org, torvalds@linux-foundation.org, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org In-Reply-To: <20171221104205.7269-25-anna-maria@linutronix.de> References: <20171221104205.7269-25-anna-maria@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:timers/core] hrtimer: Factor out __hrtimer_next_event_base() Git-Commit-ID: ad38f596d8e4babc19be8b21a7a49debffb4a7f5 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Commit-ID: ad38f596d8e4babc19be8b21a7a49debffb4a7f5 Gitweb: https://git.kernel.org/tip/ad38f596d8e4babc19be8b21a7a49debffb4a7f5 Author: Anna-Maria Gleixner AuthorDate: Thu, 21 Dec 2017 11:41:53 +0100 Committer: Ingo Molnar CommitDate: Tue, 16 Jan 2018 03:00:43 +0100 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 Cc: Christoph Hellwig Cc: John Stultz Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: keescook@chromium.org Link: http://lkml.kernel.org/r/20171221104205.7269-25-anna-maria@linutronix.de Signed-off-by: Ingo Molnar --- kernel/time/hrtimer.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 4142e6f..5d9b81d 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) #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;