Skip to contentSkip to conversation

io_uring/io-wq: remove io_wq_for_each_worker() return value

PATCH In review Jens Axboe 2 participants 2 messages Jan 5 io_uring

lore
Share & tools
lore

Jens Axboe

author maintainer
#0 lore raw

PATCH 1/1 io_uring/io-wq: remove io_wq_for_each_worker() return value

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.

---

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.

io_uring/io-wq.c +3 -6
index 6c5ef629e59a..9fd9f6ab722c 100644
@@ -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)
Signature · 1 line
Jens Axboe