* [PATCH] io_uring/io-wq: remove io_wq_for_each_worker() return value
@ 2026-01-05 18:45 Jens Axboe
2026-01-05 22:34 ` Gabriel Krisman Bertazi
0 siblings, 1 reply; 2+ messages in thread
From: Jens Axboe @ 2026-01-05 18:45 UTC (permalink / raw)
To: io-uring
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] io_uring/io-wq: remove io_wq_for_each_worker() return value
2026-01-05 18:45 [PATCH] io_uring/io-wq: remove io_wq_for_each_worker() return value Jens Axboe
@ 2026-01-05 22:34 ` Gabriel Krisman Bertazi
0 siblings, 0 replies; 2+ messages in thread
From: Gabriel Krisman Bertazi @ 2026-01-05 22:34 UTC (permalink / raw)
To: Jens Axboe; +Cc: io-uring
Jens Axboe <axboe@kernel.dk> writes:
> 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>
Looks good
Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
--
Gabriel Krisman Bertazi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-05 22:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-05 18:45 [PATCH] io_uring/io-wq: remove io_wq_for_each_worker() return value Jens Axboe
2026-01-05 22:34 ` Gabriel Krisman Bertazi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox