From: Thorsten Blum <thorsten.blum@toblux.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: asml.silence@gmail.com, io-uring@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] io_uring/net: Remove unneeded if check in io_net_vec_assign()
Date: Mon, 12 Aug 2024 00:37:08 +0200 [thread overview]
Message-ID: <57E4D3C3-5960-4F71-9391-C480E9FD310F@toblux.com> (raw)
In-Reply-To: <1207e17b-7a32-42b1-8047-b01e221ab3a9@kernel.dk>
On 12. Aug 2024, at 00:31, Jens Axboe <axboe@kernel.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.
prev parent reply other threads:[~2024-08-11 22:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-11 22:26 Thorsten Blum
2024-08-11 22:31 ` Jens Axboe
2024-08-11 22:37 ` Thorsten Blum [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57E4D3C3-5960-4F71-9391-C480E9FD310F@toblux.com \
--to=thorsten.blum@toblux.com \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®