[PATCH liburing 1/4] test: Remove unused global variables found by clang-23

Ammar Faizi <[email protected]> Sat, 25 Jul 2026 05:59:02 +0700
Newsgroups org.kernel.vger.io-uring
Message-ID <[email protected]>
In preparation for upgrading to Clang 23, fix the following warnings:

  iopoll.c:26:12: error: variable 'no_hybrid' set but not used [-Werror,-Wunused-but-set-global]
  recvmsg-inc-tail.c:66:25: error: variable 'no_recv_mshot' set but not used [-Werror,-Wunused-but-set-global]
  reg-wait.c:26:13: error: variable 'has_kernel_regions' set but not used [-Werror,-Wunused-but-set-global]

`no_hybrid` has been unused since commit c5eead2659ef ("test/iopoll:
fix over-eager no_hybrid check"); `no_recv_mshot` was never used since
it was introduced. `has_kernel_regions` has been unused since commit
30ce99006af9 ("test/reg-wait: basic test + probing of kernel regions").

Fixes: c5eead2659ef ("test/iopoll: fix over-eager no_hybrid check")
Fixes: 3891a21ffec6 ("Add test case for minimum length left for incremental buffers")
Fixes: 30ce99006af9 ("test/reg-wait: basic test + probing of kernel regions")
Cc: Christian Mazakas <[email protected]>
Signed-off-by: Ammar Faizi <[email protected]>
---
 test/iopoll.c           | 5 +----
 test/recvmsg-inc-tail.c | 3 +--
 test/reg-wait.c         | 8 ++------
 3 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/test/iopoll.c b/test/iopoll.c
index 98230657a2fa..d68fde10e3f2 100644
--- a/test/iopoll.c
+++ b/test/iopoll.c
@@ -23,7 +23,6 @@
 static struct iovec *vecs;
 static int no_buf_select;
 static int no_iopoll;
-static int no_hybrid;
 
 static int provide_buffers(struct io_uring *ring)
 {
@@ -372,10 +371,8 @@ static int test_io(const char *file, int write, int sqthread, int fixed,
 		return 0;
 	}
 	if (ret != T_SETUP_OK) {
-		if (ring_flags & IORING_SETUP_HYBRID_IOPOLL) {
-			no_hybrid = 1;
+		if (ring_flags & IORING_SETUP_HYBRID_IOPOLL)
 			return 0;
-		}
 		fprintf(stderr, "ring create failed: %d\n", ret);
 		return 1;
 	}
diff --git a/test/recvmsg-inc-tail.c b/test/recvmsg-inc-tail.c
index 29b6c2b4a96f..6be1bbf7a73e 100644
--- a/test/recvmsg-inc-tail.c
+++ b/test/recvmsg-inc-tail.c
@@ -63,7 +63,7 @@
 
 static const int expected_bids[NR_SENDS] = { 0, 0, 1, 1, 1, 2, 2, 2, 3 };
 
-static int no_buf_ring, no_recv_mshot;
+static int no_buf_ring;
 
 static int setup_buf_ring(struct io_uring *ring, void **buf_mem,
 			  struct io_uring_buf_ring **out_br)
@@ -195,7 +195,6 @@ static int test(void)
 		}
 
 		if (cqe->res == -EINVAL || cqe->res == -ENOTSUP) {
-			no_recv_mshot = 1;
 			io_uring_cqe_seen(&ring, cqe);
 			ret_val = T_EXIT_SKIP;
 			goto out_close;
diff --git a/test/reg-wait.c b/test/reg-wait.c
index af517a1f2936..ea4c3405de53 100644
--- a/test/reg-wait.c
+++ b/test/reg-wait.c
@@ -23,8 +23,6 @@ static const struct io_uring_reg_wait brief_wait = {
 	.ts.tv_nsec = 1000,
 };
 
-static bool has_kernel_regions;
-
 static int test_wait_reg_offset(struct io_uring *ring,
 				 unsigned wait_nr, unsigned long offset)
 {
@@ -382,16 +380,14 @@ static int test_regions(void)
 	rd.flags = 0;
 	rd.user_addr = 0;
 	ret = test_try_register_region(&mr, true);
-	if (ret == -EINVAL) {
-		has_kernel_regions = false;
+	if (ret == -EINVAL)
 		goto out;
-	}
+
 	if (ret) {
 		fprintf(stderr, "test_try_register_region() failed kernel alloc %i\n", ret);
 		return T_EXIT_FAIL;
 	}
 
-	has_kernel_regions = true;
 	rd.flags = 0;
 	rd.user_addr = uring_ptr_to_u64(buffer);
 	ret = test_try_register_region(&mr, true);
-- 
Ammar Faizi