io_uring/net: Remove useless min_not_zero() usage

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>
Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
Link: https://patch.msgid.link/20261023144953.3584118-1-cleger@meta.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Clément Léger 2026-10-23 07:49:52 -07:00 committed by Jens Axboe
parent 18d3f56eb6
commit 70884ea2d6

View File

@ -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)