public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] io_uring/net: Remove useless min_not_zero() usage
@ 2026-10-23 14:49 Clément Léger
  2026-10-23 15:05 ` Gabriel Krisman Bertazi
  0 siblings, 1 reply; 2+ messages in thread
From: Clément Léger @ 2026-10-23 14:49 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Clément Léger, io-uring, linux-kernel

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-23 15:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-23 14:49 [PATCH] io_uring/net: Remove useless min_not_zero() usage Clément Léger
2026-10-23 15:05 ` Gabriel Krisman Bertazi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox