From nobody Mon Dec 29 04:59:58 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10BB9C4167B for ; Fri, 1 Dec 2023 09:27:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378027AbjLAJ1h (ORCPT ); Fri, 1 Dec 2023 04:27:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378065AbjLAJ1U (ORCPT ); Fri, 1 Dec 2023 04:27:20 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44A8B171A for ; Fri, 1 Dec 2023 01:27:14 -0800 (PST) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701422833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+S43URzdkm4GE5deeh35HedlVNn9pKmfGb0vCPSVNJU=; b=el5AdGLCIQZcbBus9nb/xgs+vY+Tv76/155OcrpNkNOjUWHu2Iay04ijEup/CZKYAfF+qh sLqmjFN9GHKVRUzf9cRZklprE52pJ9L8kUfKjnGdDNVQK2XqUFEQ+6+hzipfaedbaRthZm 6Kl2Obge+HPzfqeWxSHmaScooCQbrXk8SOQ3Ik/mN0vTv4iSaOEZbdKEONwbdxIV5BJU/E WNrcDanyKol7UClRMoZbNgCpdqMNa08bdC3xYLNna5+c2HQf/8kKGMT+GtVdqx2WIXo3RJ RgKdDCKh3NQUBx0fiAdJKLos3M2mXq790/QjjGt3MOHAEXZREpaJo/p+qtLbPw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701422833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+S43URzdkm4GE5deeh35HedlVNn9pKmfGb0vCPSVNJU=; b=HxtFSzHBtGc0DacUydRzFJpAQaTMJ4mc5tul79/rcY9HP9L9pECbfeBHsmnvjQJFudbZJQ DO5tluaLRIL1/YCA== To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , John Stultz , Thomas Gleixner , Eric Dumazet , "Rafael J . Wysocki" , Arjan van de Ven , "Paul E . McKenney" , Frederic Weisbecker , Rik van Riel , Steven Rostedt , Sebastian Siewior , Giovanni Gherdovich , Lukasz Luba , "Gautham R . Shenoy" , Srinivas Pandruvada , K Prateek Nayak , Anna-Maria Behnsen Subject: [PATCH v9 10/32] timers: Use already existing function for forwarding timer base Date: Fri, 1 Dec 2023 10:26:32 +0100 Message-Id: <20231201092654.34614-11-anna-maria@linutronix.de> In-Reply-To: <20231201092654.34614-1-anna-maria@linutronix.de> References: <20231201092654.34614-1-anna-maria@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" There is an already existing function for forwarding the timer base. Forwarding the timer base is implemented directly in get_next_timer_interrupt() as well. Remove the code duplication and invoke __forward_timer_base() instead. Signed-off-by: Anna-Maria Behnsen Reviewed-by: Frederic Weisbecker --- kernel/time/timer.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index e289cbd84e8c..fee42dda8237 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1939,15 +1939,9 @@ u64 get_next_timer_interrupt(unsigned long basej, u6= 4 basem) =20 /* * We have a fresh next event. Check whether we can forward the - * base. We can only do that when @basej is past base->clk - * otherwise we might rewind base->clk. + * base. */ - if (time_after(basej, base->clk)) { - if (time_after(nextevt, basej)) - base->clk =3D basej; - else if (time_after(nextevt, base->clk)) - base->clk =3D nextevt; - } + __forward_timer_base(base, basej); =20 if (time_before_eq(nextevt, basej)) { expires =3D basem; --=20 2.39.2