Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp904704rdb; Fri, 1 Dec 2023 01:28:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IFQEQODNUIH2VQyR1Du5X17YVuvgQHQsiYc3InHRdZt0rOUpEbowTcHT156Rp+KGSg4GDQI X-Received: by 2002:a05:6a20:6728:b0:18b:8b4:2dde with SMTP id q40-20020a056a20672800b0018b08b42ddemr24751879pzh.61.1701422911732; Fri, 01 Dec 2023 01:28:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701422911; cv=none; d=google.com; s=arc-20160816; b=crProKQ3delCxRxXRiMh4biNcmqNmuI3ORLFTqjjLue8otf0ruqS21h/y6QZWzpAM0 I+6MJzIJqR+SsUBdgCDD3b8Ly2EqjZa0QqYSSyuWJGHGqwUh74cEiPg6d38WVtjXHUiB +YMudYLZducoKWpDLScoIlq8fAyMTf3UABaTW8TLmFMyEPv1d6LoKucEDcfp2CQ6SVI7 2luIteypw0l4fWY6rUYUmksd/qfx2uJYR60TReVV0KQ3MWu8wWqNe6hbTTrDlS/9p1+h wm9Gu1Efn0qwEFy3gRlsLEX/c7ZPkZa42Tm8i+fsmE1sZR/p9v+Up9pyoXjsFiBVAWAW Q/ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=+S43URzdkm4GE5deeh35HedlVNn9pKmfGb0vCPSVNJU=; fh=PG6uS4TiiUSDyl8D/joYkWbwCgDm4ug0ir2h7tHBJXQ=; b=illFZeIdX4SBbPItG7ViOf/xAwCEogbZTIMN6grhVLed4ItWAxR5kYoKAXvSXQ9rt6 TzAKZRpeWPzcG7reMQ+u6jN61iThpRZBY7z+wnk/yB4b8K5UAlli1znpFeBMP3rIWDcb SsTR4oA24Ya6+k0eP50ayGP8581CqDNI0S4ubBexr/jQhvx2caKcgPxw8uXSXwjMBZcE kqejzwYgll9gfaDMJvHKsxUGfRZgIU6zumtFLEQlehjiePRk0CiOuRO5U+MPjnNaDTCj yP0/5pSlMrAZg2Dmk6y0xzmzV9Hpi+f2jHFKsp4pAGTQeaoVjLZ3FRm86Ee29boJxspa VOCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=el5AdGLC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id e9-20020a170902b78900b001b045d65aedsi1310437pls.228.2023.12.01.01.28.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 01:28:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=el5AdGLC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 0D71F83D9B77; Fri, 1 Dec 2023 01:28:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378104AbjLAJ1f (ORCPT + 99 others); Fri, 1 Dec 2023 04:27:35 -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: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 01 Dec 2023 01:28:25 -0800 (PST) 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, u64 basem) /* * 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 = basej; - else if (time_after(nextevt, base->clk)) - base->clk = nextevt; - } + __forward_timer_base(base, basej); if (time_before_eq(nextevt, basej)) { expires = basem; -- 2.39.2