All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Clément Léger" <cleger@meta.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: "Clément Léger" <cleger@meta.com>,
	io-uring@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] io_uring/net: Remove useless min_not_zero() usage
Date: Fri, 23 Oct 2026 07:49:52 -0700	[thread overview]
Message-ID: <20261023144953.3584118-1-cleger@meta.com> (raw)

In the else arm, sel->val is necessarily 0 so the min_not_zero() actually
always returns kmsg->msg.msg_inq. Remove the min_not_zero() usage and
replace it with kmsg->msg.msg_inq.

Signed-off-by: Clément Léger <cleger@meta.com>
---
 io_uring/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/io_uring/net.c b/io_uring/net.c
index f5f4f3ce6ef3..efc8ea5010ad 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -1146,7 +1146,7 @@ static int io_recv_buf_select(struct io_kiocb *req, struct io_async_msghdr *kmsg
 		if (sel->val)
 			arg.max_len = sel->val;
 		else if (kmsg->msg.msg_inq > 1)
-			arg.max_len = min_not_zero(sel->val, (ssize_t) kmsg->msg.msg_inq);
+			arg.max_len = kmsg->msg.msg_inq;

 		/* if mshot limited, ensure we don't go over */
 		if (sr->flags & IORING_RECV_MSHOT_LIM)
--
2.53.0-Meta

             reply	other threads:[~2026-10-23 14:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23 14:49 Clément Léger [this message]
2026-10-23 15:05 ` [PATCH] io_uring/net: Remove useless min_not_zero() usage Gabriel Krisman Bertazi
2026-10-26 18:13 ` Jens Axboe

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=20261023144953.3584118-1-cleger@meta.com \
    --to=cleger@meta.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.