Le Tue, May 19, 2026 at 09:45:21PM +0200, Uladzislau Rezki (Sony) a écrit :
> From: "Paul E. McKenney" <[email protected]>
> 
> 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.
> 
> Signed-off-by: Paul E. McKenney <[email protected]>
> Signed-off-by: Uladzislau Rezki (Sony) <[email protected]>

Reviewed-by: Frederic Weisbecker <[email protected]>


> ---
>  kernel/rcu/tree.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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;
> -- 
> 2.47.3
> 
> 

-- 
Frederic Weisbecker
SUSE Labs

Reply via email to