From: Xichao Zhao <zhao.xichao@vivo.com>
To: axboe@kernel.dk
Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org,
Xichao Zhao <zhao.xichao@vivo.com>
Subject: [PATCH] io_uring: Remove unnecessary conditional statement
Date: Fri, 15 Aug 2025 15:58:05 +0800 [thread overview]
Message-ID: <20250815075805.580465-1-zhao.xichao@vivo.com> (raw)
In the kfree() function, the passed argument is checked. Therefore,
the conditional statement in io_free_batch_list() can be removed.
Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
io_uring/io_uring.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 4ef69dd58734..7a9106066653 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1469,8 +1469,7 @@ static void io_free_batch_list(struct io_ring_ctx *ctx,
if ((req->flags & REQ_F_POLLED) && req->apoll) {
struct async_poll *apoll = req->apoll;
- if (apoll->double_poll)
- kfree(apoll->double_poll);
+ kfree(apoll->double_poll);
io_cache_free(&ctx->apoll_cache, apoll);
req->flags &= ~REQ_F_POLLED;
}
--
2.34.1
reply other threads:[~2025-08-15 7:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250815075805.580465-1-zhao.xichao@vivo.com \
--to=zhao.xichao@vivo.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