]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rcu: Simplify param_set_next_fqs_jiffies() by applying clamp_val()
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 8 May 2026 17:43:52 +0000 (10:43 -0700)
committerUladzislau Rezki (Sony) <urezki@gmail.com>
Sun, 24 May 2026 07:39:57 +0000 (09:39 +0200)
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 <frederic@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
kernel/rcu/tree.c

index e46a5124c3eb8824c07a06bfa697d7fce6b044d0..09f0cef5014c7c9028219797f919f51f05427f16 100644 (file)
@@ -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;