From: Paul E. McKenney Date: Fri, 8 May 2026 17:43:52 +0000 (-0700) Subject: rcu: Simplify param_set_next_fqs_jiffies() by applying clamp_val() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9b4d36b8c8fb6006e7b62dd0ddc218c87e8196a;p=thirdparty%2Fkernel%2Fstable.git rcu: Simplify param_set_next_fqs_jiffies() by applying clamp_val() This commit replaces a nested ?: sequence with clamp_val(). This does not reduce the number of lines of code, but it does simplify the line that it modifies. Reviewed-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney Signed-off-by: Uladzislau Rezki (Sony) --- diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index e46a5124c3eb..09f0cef5014c 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -492,7 +492,7 @@ static int param_set_next_fqs_jiffies(const char *val, const struct kernel_param int ret = kstrtoul(val, 0, &j); if (!ret) { - WRITE_ONCE(*(ulong *)kp->arg, (j > HZ) ? HZ : (j ?: 1)); + WRITE_ONCE(*(ulong *)kp->arg, clamp_val(j, 1, HZ)); adjust_jiffies_till_sched_qs(); } return ret;