From 70884ea2d636611e547f3da85fbfb8aadfa2ab4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= Date: Fri, 23 Oct 2026 07:49:52 -0700 Subject: [PATCH] io_uring/net: Remove useless min_not_zero() usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Gabriel Krisman Bertazi Link: https://patch.msgid.link/20261023144953.3584118-1-cleger@meta.com Signed-off-by: Jens Axboe --- 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 4678f29f5177..e332b3a2ad3e 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -1166,7 +1166,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)