From: Ammar Faizi <ammarfaizi2@openresty.com>
To: Jens Axboe <axboe@kernel.dk>,
io-uring Mailing List <io-uring@vger.kernel.org>
Cc: Ammar Faizi <ammarfaizi2@openresty.com>,
Yichun Zhang <yichun@openresty.com>,
Christian Mazakas <christian.mazakas@gmail.com>
Subject: [PATCH liburing 1/4] test: Remove unused global variables found by clang-23
Date: Sat, 25 Jul 2026 05:59:02 +0700 [thread overview]
Message-ID: <20260724225905.747718-2-ammarfaizi2@openresty.com> (raw)
In-Reply-To: <20260724225905.747718-1-ammarfaizi2@openresty.com>
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 <christian.mazakas@gmail.com>
Signed-off-by: Ammar Faizi <ammarfaizi2@openresty.com>
---
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
next prev parent reply other threads:[~2026-07-24 22:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 22:59 [PATCH liburing 0/4] Upgrade to Clang 23 and git tree link update Ammar Faizi
2026-07-24 22:59 ` Ammar Faizi [this message]
2026-07-24 22:59 ` [PATCH liburing 2/4] ci: Fix the wrong `cc_pkg` comparison Ammar Faizi
2026-07-24 22:59 ` [PATCH liburing 3/4] ci: Upgrade clang version to 23 Ammar Faizi
2026-07-24 22:59 ` [PATCH liburing 4/4] liburing{{,-ffi}.pc.in,.spec}: Replace dead git tree links with the new one Ammar Faizi
2026-07-25 10:57 ` [PATCH liburing 0/4] Upgrade to Clang 23 and git tree link update 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=20260724225905.747718-2-ammarfaizi2@openresty.com \
--to=ammarfaizi2@openresty.com \
--cc=axboe@kernel.dk \
--cc=christian.mazakas@gmail.com \
--cc=io-uring@vger.kernel.org \
--cc=yichun@openresty.com \
/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