lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211025145906.71955-1-quic_qiancai@quicinc.com>
Date:   Mon, 25 Oct 2021 10:59:06 -0400
From:   Qian Cai <quic_qiancai@...cinc.com>
To:     Jens Axboe <axboe@...nel.dk>,
        Pavel Begunkov <asml.silence@...il.com>
CC:     <io-uring@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        Qian Cai <quic_qiancai@...cinc.com>
Subject: [PATCH] io_uring: fix a GCC warning in wq_list_for_each()

fs/io_uring.c: In function '__io_submit_flush_completions':
fs/io_uring.c:2367:33: warning: variable 'prev' set but not used
[-Wunused-but-set-variable]
 2367 |  struct io_wq_work_node *node, *prev;
      |                                 ^~~~

Fixed it by open-coded the wq_list_for_each() without an unused previous
node pointer.

Fixes: 6f33b0bc4ea4 ("io_uring: use slist for completion batching")
Signed-off-by: Qian Cai <quic_qiancai@...cinc.com>
---
 fs/io_uring.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 23641d9e0871..b8968bd43e3f 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2361,11 +2361,11 @@ static void io_free_batch_list(struct io_ring_ctx *ctx,
 static void __io_submit_flush_completions(struct io_ring_ctx *ctx)
 	__must_hold(&ctx->uring_lock)
 {
-	struct io_wq_work_node *node, *prev;
+	struct io_wq_work_node *node;
 	struct io_submit_state *state = &ctx->submit_state;
 
 	spin_lock(&ctx->completion_lock);
-	wq_list_for_each(node, prev, &state->compl_reqs) {
+	for (node = state->compl_reqs.first; node; node = node->next) {
 		struct io_kiocb *req = container_of(node, struct io_kiocb,
 						    comp_list);
 
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ