From nobody Mon Dec 29 05:02:14 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 24994C4167B for ; Fri, 1 Dec 2023 09:27:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378031AbjLAJ1G (ORCPT ); Fri, 1 Dec 2023 04:27:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378004AbjLAJ1C (ORCPT ); Fri, 1 Dec 2023 04:27:02 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E703D10F3 for ; Fri, 1 Dec 2023 01:27:08 -0800 (PST) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701422827; 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=jl8/xzU+GiuSpXdMfzNJncPixT2cuPm0ChHCjye17qI=; b=PRcshUeiqQBP6Ypl/4igU9gnAZax/WZ9o6XJmRkijSQlV8N4QjPU98SYISHBREqA75uWZe aXLpTqOnLIMMSJtBYXQmc9vf6PUTFIdnVOz1ssiOQTEDoFR/CgOrgEXe6urDrJO3mAyMOZ CnXf0fRTJBCt/jCRZ09/255zi7frJtW4JTzBXU4m3SuzthrUHV2wDxvgqhxrl/ebelKOPs 8+OOkyFutkDdkDCpN3W0Cap8wApvWQSwQCdI0nIAKfgUSjYLhsPGYaaWgOTaY6tPN0rP28 fpvOInjCw9cXNbhxFLhb7yxte3vgMP/miUKuEACWllOZLXZawL5HAxaL+esNsA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701422827; 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=jl8/xzU+GiuSpXdMfzNJncPixT2cuPm0ChHCjye17qI=; b=Sb+rjhnebJJIO1g9BgSS4qyOLxH+tt5Barqeak47ZCMSmExPUqtDHBEroBlyuhU1DJydwt x7ySNlMzzhm9QdCg== 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 02/32] tick/sched: Cleanup confusing variables Date: Fri, 1 Dec 2023 10:26:24 +0100 Message-Id: <20231201092654.34614-3-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" tick_nohz_stop_tick() contains the expires (u64 variable) and tick (ktime_t) variable. In the beginning the value of expires is written to tick. Afterwards none of the variables is changed. They are only used for checks. Drop the not required variable tick and use always expires instead. Signed-off-by: Anna-Maria Behnsen Reviewed-by: Frederic Weisbecker --- v9: Fix typo in commit message --- kernel/time/tick-sched.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 5c28cc80fd25..89517cfb6510 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -887,7 +887,6 @@ static void tick_nohz_stop_tick(struct tick_sched *ts, = int cpu) struct clock_event_device *dev =3D __this_cpu_read(tick_cpu_device.evtdev= ); u64 basemono =3D ts->timer_expires_base; u64 expires =3D ts->timer_expires; - ktime_t tick =3D expires; =20 /* Make sure we won't be trying to stop it twice in a row. */ ts->timer_expires_base =3D 0; @@ -910,7 +909,7 @@ static void tick_nohz_stop_tick(struct tick_sched *ts, = int cpu) /* Skip reprogram of event if it's not changed */ if (ts->tick_stopped && (expires =3D=3D ts->next_tick)) { /* Sanity check: make sure clockevent is actually programmed */ - if (tick =3D=3D KTIME_MAX || ts->next_tick =3D=3D hrtimer_get_expires(&t= s->sched_timer)) + if (expires =3D=3D KTIME_MAX || ts->next_tick =3D=3D hrtimer_get_expires= (&ts->sched_timer)) return; =20 WARN_ON_ONCE(1); @@ -935,7 +934,7 @@ static void tick_nohz_stop_tick(struct tick_sched *ts, = int cpu) trace_tick_stop(1, TICK_DEP_MASK_NONE); } =20 - ts->next_tick =3D tick; + ts->next_tick =3D expires; =20 /* * If the expiration time =3D=3D KTIME_MAX, then we simply stop @@ -950,11 +949,11 @@ static void tick_nohz_stop_tick(struct tick_sched *ts= , int cpu) } =20 if (ts->nohz_mode =3D=3D NOHZ_MODE_HIGHRES) { - hrtimer_start(&ts->sched_timer, tick, + hrtimer_start(&ts->sched_timer, expires, HRTIMER_MODE_ABS_PINNED_HARD); } else { - hrtimer_set_expires(&ts->sched_timer, tick); - tick_program_event(tick, 1); + hrtimer_set_expires(&ts->sched_timer, expires); + tick_program_event(expires, 1); } } =20 --=20 2.39.2