[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <57E4D3C3-5960-4F71-9391-C480E9FD310F@toblux.com>
Date: Mon, 12 Aug 2024 00:37:08 +0200
From: Thorsten Blum <thorsten.blum@...lux.com>
To: Jens Axboe <axboe@...nel.dk>
Cc: asml.silence@...il.com,
io-uring@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] io_uring/net: Remove unneeded if check in
io_net_vec_assign()
On 12. Aug 2024, at 00:31, Jens Axboe <axboe@...nel.dk> wrote:
> On 8/11/24 4:26 PM, Thorsten Blum wrote:
>> kfree() already checks if its argument is NULL. Remove the unneeded if
>> check and fix the following Coccinelle/coccicheck warning reported by
>> ifnullfree.cocci:
>>
>> WARNING: NULL check before some freeing functions is not needed
>
> Yes it's not needed, but the NULL check is done after a function call.
> For the hot path, it's FASTER to check if it's NULL or not.
>
> I can put a comment on these, but honestly I wish the ifnullfree
> thing would just go away as it's hardly useful for anything. It's
> not like it's a bug to check for NULL first, or that it would find
> something useful.
Ok, thanks for explaining.
Powered by blists - more mailing lists