From: Jens Axboe <axboe@kernel.dk>
To: Thorsten Blum <thorsten.blum@toblux.com>, asml.silence@gmail.com
Cc: 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: Sun, 11 Aug 2024 16:31:23 -0600 [thread overview]
Message-ID: <1207e17b-7a32-42b1-8047-b01e221ab3a9@kernel.dk> (raw)
In-Reply-To: <20240811222638.24464-2-thorsten.blum@toblux.com>
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.
--
Jens Axboe
next prev parent reply other threads:[~2024-08-11 22:31 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 [this message]
2024-08-11 22:37 ` Thorsten Blum
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=1207e17b-7a32-42b1-8047-b01e221ab3a9@kernel.dk \
--to=axboe@kernel.dk \
--cc=asml.silence@gmail.com \
--cc=io-uring@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=thorsten.blum@toblux.com \
/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®