public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: io-uring <io-uring@vger.kernel.org>
Subject: [PATCH] io_uring/io-wq: remove io_wq_for_each_worker() return value
Date: Mon, 5 Jan 2026 11:45:50 -0700	[thread overview]
Message-ID: <708b2a6d-7c87-4f94-8d15-c450228c6b6b@kernel.dk> (raw)

The only use of this helper is to iterate all of the workers, and
hence all callers will pass in a func that always returns false to do
that. As none of the callers use the return value, get rid of it.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

---

Followup to previous patch fixing an issue with the iteration, while
at it let's clean up the io_wq_for_each_worker() helper to always
just return void as no callers use the return value.

This could potentially go one step further and ignore the
io_acct_for_each_worker() return value as well, but let's keep it as-is
in that regard, for the case where a new caller is added that does
provide a func that may return true to terminate the iteration.

diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c
index 6c5ef629e59a..9fd9f6ab722c 100644
--- a/io_uring/io-wq.c
+++ b/io_uring/io-wq.c
@@ -947,16 +947,13 @@ static bool io_acct_for_each_worker(struct io_wq_acct *acct,
 	return ret;
 }
 
-static bool io_wq_for_each_worker(struct io_wq *wq,
+static void io_wq_for_each_worker(struct io_wq *wq,
 				  bool (*func)(struct io_worker *, void *),
 				  void *data)
 {
-	for (int i = 0; i < IO_WQ_ACCT_NR; i++) {
+	for (int i = 0; i < IO_WQ_ACCT_NR; i++)
 		if (io_acct_for_each_worker(&wq->acct[i], func, data))
-			return true;
-	}
-
-	return false;
+			break;
 }
 
 static bool io_wq_worker_wake(struct io_worker *worker, void *data)
-- 
Jens Axboe


             reply	other threads:[~2026-01-05 18:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05 18:45 Jens Axboe [this message]
2026-01-05 22:34 ` [PATCH] io_uring/io-wq: remove io_wq_for_each_worker() return value Gabriel Krisman Bertazi

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=708b2a6d-7c87-4f94-8d15-c450228c6b6b@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=io-uring@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