Re: [PATCH] timekeeping: Use min() to fix Coccinelle warning

From: Thomas Gleixner
Date: Tue Jun 25 2024 - 02:36:20 EST


Thorsten!

On Mon, Jun 24 2024 at 08:24, Thorsten Blum wrote:

> Fixes the following Coccinelle/coccicheck warning reported by
> minmax.cocci:
>
> WARNING opportunity for min()

I'm fine with the change, but not so much with the change log.

You cannot fix a coccinelle warning. You can only fix the code which
triggers the warning, right?

'Opportunity to use min()' is nothing else than an opportunity, but
what's the benefit of replacing correct code with it? What does this
fix?

It fixes nothing. So calling it a fix is confusing at best.

What you want to say is something like this:

Subject: timekeeping: Replace open coded min()

Replace open coded min() because $GOOD_REASON

Discovered by minmax.cocci

$GOOD_REASON is not 'coccinelle emitted a warning'.

Thanks,

tglx