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

From: Marco Elver
Date: Mon Jul 01 2024 - 04:08:14 EST


On Sun, 30 Jun 2024 at 22:03, Thorsten Blum <thorsten.blum@xxxxxxxxxx> wrote:
>
> Fixes the following Coccinelle/coccicheck warning reported by
> minmax.cocci:
>
> WARNING opportunity for min()
>
> Use size_t instead of int for the result of min().
>
> Compile-tested with CONFIG_KCSAN=y.
>
> Reviewed-by: Marco Elver <elver@xxxxxxxxxx>
> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxxx>
> ---
> Changes in v2:
> - Add const and remove redundant parentheses as suggested by Marco Elver
> - Link to v1: https://lore.kernel.org/linux-kernel/20240623220606.134718-2-thorsten.blum@xxxxxxxxxx/
>
> Changes in v3:
> - Remove const again after feedback from David Laight

I think I was clear that the removal of const was not needed in this
case, and my preference was to keep const.

While general and _constructive_ comments are helpful and appreciated,
this level of nit-picking and bikeshedding about 'const' is a complete
and utter waste of time. I'm sorry, but I'm rather allergic to this
level of time-wasting.

As KCSAN maintainer, I'm just going to say I prefer v2.

> - Link to v2: https://lore.kernel.org/linux-kernel/20240624175727.88012-2-thorsten.blum@xxxxxxxxxx/

[+Cc Paul]

Paul, if possible kindly pick v2 of this patch into the KCSAN tree:
https://lore.kernel.org/linux-kernel/20240624175727.88012-2-thorsten.blum@xxxxxxxxxx/

Many thanks,
-- Marco