From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751997AbdHaM1w (ORCPT ); Thu, 31 Aug 2017 08:27:52 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:60580 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751662AbdHaMXm (ORCPT ); Thu, 31 Aug 2017 08:23:42 -0400 Message-Id: <20170831105826.690491714@linutronix.de> User-Agent: quilt/0.63-1 Date: Thu, 31 Aug 2017 12:23:40 -0000 From: Anna-Maria Gleixner To: LKML Cc: Peter Zijlstra , Ingo Molnar , Christoph Hellwig , keescook@chromium.org, John Stultz , Thomas Gleixner Subject: [PATCH 14/25] hrtimer: Split out code from __hrtimer_get_next_event() for reuse References: <20170831105725.809317030@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline; filename=hrtimer_Split_out_code_from___hrtimer_get_next_event()_for_reuse.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anna-Maria Gleixner Preparatory patch for softirq based hrtimers. No functional change. Signed-off-by: Anna-Maria Gleixner --- kernel/time/hrtimer.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -454,12 +454,12 @@ static inline void hrtimer_update_next_t } #if defined(CONFIG_NO_HZ_COMMON) || defined(CONFIG_HIGH_RES_TIMERS) -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) { - unsigned int active = cpu_base->active_bases; - ktime_t expires, expires_next = KTIME_MAX; + ktime_t expires; - hrtimer_update_next_timer(cpu_base, NULL); while (active) { unsigned int id = __ffs(active); struct hrtimer_clock_base *base; @@ -486,6 +486,18 @@ static ktime_t __hrtimer_get_next_event( expires_next = 0; 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; + + hrtimer_update_next_timer(cpu_base, NULL); + + expires_next = __hrtimer_next_event_base(cpu_base, active, expires_next); + + return expires_next; +} #endif static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base)