> -----Original Message-----
> From: Jakub Kicinski <k...@kernel.org>
> Sent: Tuesday, February 6, 2024 12:03 PM
> To: Brady, Alan <alan.br...@intel.com>
> Cc: intel-wired-...@lists.osuosl.org; net...@vger.kernel.org;
> willemdebruijn.ker...@gmail.com; Kitszel, Przemyslaw
> <przemyslaw.kits...@intel.com>; Bagnucki, Igor <igor.bagnu...@intel.com>;
> Lobakin, Aleksander <aleksander.loba...@intel.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.
Maybe you could make the coccicheck only complain if the value is non-zero or
not const? Maybe that's a bit too complicated... Hm