[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANDhNCpHfnhfb8zox5TKQLAH5636xzHk1W2zBDujhmM11sshsQ@mail.gmail.com>
Date: Mon, 24 Jun 2024 11:30:39 -0700
From: John Stultz <jstultz@...gle.com>
To: Thorsten Blum <thorsten.blum@...lux.com>
Cc: tglx@...utronix.de, sboyd@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] timekeeping: Use min() to fix Coccinelle warning
On Sun, Jun 23, 2024 at 11:24 PM Thorsten Blum <thorsten.blum@...lux.com> wrote:
>
> Fixes the following Coccinelle/coccicheck warning reported by
> minmax.cocci:
>
> WARNING opportunity for min()
>
> Signed-off-by: Thorsten Blum <thorsten.blum@...lux.com>
> ---
> kernel/time/timekeeping.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
> index 4e18db1819f8..f1a9c52b7c66 100644
> --- a/kernel/time/timekeeping.c
> +++ b/kernel/time/timekeeping.c
> @@ -799,7 +799,7 @@ static void timekeeping_forward_now(struct timekeeper *tk)
>
> while (delta > 0) {
> u64 max = tk->tkr_mono.clock->max_cycles;
> - u64 incr = delta < max ? delta : max;
> + u64 incr = min(delta, max);
Acked-by: John Stultz <jstultz@...gle.com>
thanks
-john
Powered by blists - more mailing lists