[tip: timers/nohz] tick/sched: Make kernel parameter skew_tick boolean

From: tip-bot2 for Sergey Shtylyov

Date: Mon Nov 09 2026 - 10:31:00 EST


The following commit has been merged into the timers/nohz branch of tip:

Commit-ID: 438b55d86a1a96949355f6b1b17720191937beb4
Gitweb: https://git.kernel.org/tip/438b55d86a1a96949355f6b1b17720191937beb4
Author: Sergey Shtylyov <s.shtylyov@xxxxxxxxxxxx>
AuthorDate: Thu, 01 Oct 2026 23:24:09 +03:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxx>
CommitterDate: Mon, 09 Nov 2026 16:28:35 +01:00

tick/sched: Make kernel parameter skew_tick boolean

The kernel parameter skew_tick requires an integer value, despite being
boolean in nature, and the parser functions ignores errors.

Convert the static variable sched_skew_tick to 'bool' and thus use
kstrtobool() to parse the parameter's value and return an eventual parser
error to the caller. The input values 0 and 1 keep working as before.

As the variable can only be set at boot time mark it __ro_after_init.

Found by Linux Verification Center (linuxtesting.org) with the Svace
static analysis tool.

Suggested-by: Thomas Gleixner <tglx@xxxxxxxxxx>
Signed-off-by: Sergey Shtylyov <s.shtylyov@xxxxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
Link: https://patch.msgid.link/20261001202417.73273-1-s.shtylyov@xxxxxxxxxxxx
---
kernel/time/tick-sched.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index c6d86e4..5e96c2e 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -1499,13 +1499,11 @@ void tick_irq_enter(void)
tick_nohz_irq_enter();
}

-static int sched_skew_tick;
+static bool sched_skew_tick __ro_after_init;

static int __init skew_tick(char *str)
{
- get_option(&str, &sched_skew_tick);
-
- return 0;
+ return kstrtobool(str, &sched_skew_tick);
}
early_param("skew_tick", skew_tick);