[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240206120303.0fd22238@kernel.org>
Date: Tue, 6 Feb 2024 12:03:03 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Alan Brady <alan.brady@...el.com>
Cc: <intel-wired-lan@...ts.osuosl.org>, <netdev@...r.kernel.org>,
<willemdebruijn.kernel@...il.com>, <przemyslaw.kitszel@...el.com>,
<igor.bagnucki@...el.com>, <aleksander.lobakin@...el.com>
Subject: Re: [PATCH v4 00/10 iwl-next] idpf: refactor virtchnl messages
On Tue, 6 Feb 2024 11:18:48 -0800 Alan Brady wrote:
> We did run coccinelle check and see the min suggestions. It's triggering
> on these statements I added:
>
> return reply_sz < 0 ? reply_sz : 0;
>
> A min here would change it to:
>
> return min(reply_sz, 0);
>
> I didn't really like that because it's misleading as though we're
> returning the size of the reply and might accidentally encourage someone
> to change it to a max. Here reply_sz will be negative if an error was
> returned from message sending. But this function we only want to return
> 0 or negative. By being explicit in what we want to do, it seems clearer
> to me what the intention is but I could be wrong.
>
> We can definitely change it however if that's preferred here.
Hm, okay, that does sound like making it worse.
I'll disable the minmax coccicheck for now, it seems noisy.
Powered by blists - more mailing lists