[PATCH] tick/sched: make kernel parameter skew_tick boolean

From: Sergey Shtylyov

Date: Thu Oct 01 2026 - 16:34:23 EST


The kernel parameter skew_tick requires an integer value, despite being
boolean in nature. Convert the static variable sched_skew_tick to *bool*
(while at it, annotate it as __ro_after_init) and thus use kstrtobool()
to parse the parameter's value (the values 0 and 1 should keep working
as before); also stop ignoring the value parsing errors as it happened
before (when skew_tick() always returned 0)...

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>

---
The patch is against the timers/nohz branch of the tip.git repo.

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 a7893a079a83..1083eede34fc 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -1475,13 +1475,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);

--
2.55.0