public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <gabriel@krisman.be>
To: "Clément Léger" <cleger@meta.com>, "Jens Axboe" <axboe@kernel.dk>
Cc: "Clément Léger" <cleger@meta.com>,
	io-uring@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] io_uring/net: Remove useless min_not_zero() usage
Date: Fri, 23 Oct 2026 11:05:58 -0400	[thread overview]
Message-ID: <875wyssbhl.fsf@mailhost.krisman.be> (raw)
In-Reply-To: <20261023144953.3584118-1-cleger@meta.com>

Clément Léger <cleger@meta.com> writes:

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

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

-- 
Gabriel Krisman Bertazi

      reply	other threads:[~2026-10-23 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=875wyssbhl.fsf@mailhost.krisman.be \
    --to=gabriel@krisman.be \
    --cc=axboe@kernel.dk \
    --cc=cleger@meta.com \
    --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