public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Caleb Sander Mateos <csander@purestorage.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: Caleb Sander Mateos <csander@purestorage.com>,
	io-uring@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] io_uring/query: drop unused io_handle_query_entry() ctx arg
Date: Tue, 25 Nov 2025 17:59:34 -0700	[thread overview]
Message-ID: <20251126005936.3988966-1-csander@purestorage.com> (raw)

io_handle_query_entry() doesn't use its struct io_ring_ctx *ctx
argument. So remove it from the function and its callers.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
---
 io_uring/query.c    | 7 +++----
 io_uring/query.h    | 2 +-
 io_uring/register.c | 4 ++--
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/io_uring/query.c b/io_uring/query.c
index e61b6221f87f..abdd6f3e1223 100644
--- a/io_uring/query.c
+++ b/io_uring/query.c
@@ -51,12 +51,11 @@ static ssize_t io_query_scq(union io_query_data *data)
 	e->hdr_size = sizeof(struct io_rings);
 	e->hdr_alignment = SMP_CACHE_BYTES;
 	return sizeof(*e);
 }
 
-static int io_handle_query_entry(struct io_ring_ctx *ctx,
-				 union io_query_data *data, void __user *uhdr,
+static int io_handle_query_entry(union io_query_data *data, void __user *uhdr,
 				 u64 *next_entry)
 {
 	struct io_uring_query_hdr hdr;
 	size_t usize, res_size = 0;
 	ssize_t ret = -EINVAL;
@@ -105,11 +104,11 @@ static int io_handle_query_entry(struct io_ring_ctx *ctx,
 		return -EFAULT;
 	*next_entry = hdr.next_entry;
 	return 0;
 }
 
-int io_query(struct io_ring_ctx *ctx, void __user *arg, unsigned nr_args)
+int io_query(void __user *arg, unsigned nr_args)
 {
 	union io_query_data entry_buffer;
 	void __user *uhdr = arg;
 	int ret, nr = 0;
 
@@ -119,11 +118,11 @@ int io_query(struct io_ring_ctx *ctx, void __user *arg, unsigned nr_args)
 		return -EINVAL;
 
 	while (uhdr) {
 		u64 next_hdr;
 
-		ret = io_handle_query_entry(ctx, &entry_buffer, uhdr, &next_hdr);
+		ret = io_handle_query_entry(&entry_buffer, uhdr, &next_hdr);
 		if (ret)
 			return ret;
 		uhdr = u64_to_user_ptr(next_hdr);
 
 		/* Have some limit to avoid a potential cycle */
diff --git a/io_uring/query.h b/io_uring/query.h
index 171d47ccaaba..b35eb52f0ea8 100644
--- a/io_uring/query.h
+++ b/io_uring/query.h
@@ -2,8 +2,8 @@
 #ifndef IORING_QUERY_H
 #define IORING_QUERY_H
 
 #include <linux/io_uring_types.h>
 
-int io_query(struct io_ring_ctx *ctx, void __user *arg, unsigned nr_args);
+int io_query(void __user *arg, unsigned nr_args);
 
 #endif
diff --git a/io_uring/register.c b/io_uring/register.c
index db42f98562c4..62d39b3ff317 100644
--- a/io_uring/register.c
+++ b/io_uring/register.c
@@ -811,11 +811,11 @@ static int __io_uring_register(struct io_ring_ctx *ctx, unsigned opcode,
 		if (!arg || nr_args != 1)
 			break;
 		ret = io_register_mem_region(ctx, arg);
 		break;
 	case IORING_REGISTER_QUERY:
-		ret = io_query(ctx, arg, nr_args);
+		ret = io_query(arg, nr_args);
 		break;
 	case IORING_REGISTER_ZCRX_CTRL:
 		ret = io_zcrx_ctrl(ctx, arg, nr_args);
 		break;
 	default:
@@ -886,11 +886,11 @@ static int io_uring_register_blind(unsigned int opcode, void __user *arg,
 {
 	switch (opcode) {
 	case IORING_REGISTER_SEND_MSG_RING:
 		return io_uring_register_send_msg_ring(arg, nr_args);
 	case IORING_REGISTER_QUERY:
-		return io_query(NULL, arg, nr_args);
+		return io_query(arg, nr_args);
 	}
 	return -EINVAL;
 }
 
 SYSCALL_DEFINE4(io_uring_register, unsigned int, fd, unsigned int, opcode,
-- 
2.45.2


             reply	other threads:[~2025-11-26  0:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26  0:59 Caleb Sander Mateos [this message]
2025-11-26 17:14 ` [PATCH] io_uring/query: drop unused io_handle_query_entry() ctx arg 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=20251126005936.3988966-1-csander@purestorage.com \
    --to=csander@purestorage.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox