Skip to contentSkip to conversation

io_uring: remove dead code after drain rework

PATCH In review Pavel Begunkov 2 participants 2 messages May 11, 2025 – May 12, 2025 io_uring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring: remove dead code after drain rework

io_drain_req() uses a helper function for counting the number of requests in a link, remove unused open coded accounting that was accidentially left.

---

Should also be fine to squash into the original patch

 io_uring/io_uring.c | 4 ----
 1 file changed, 4 deletions(-)
io_uring/io_uring.c +0 -4
index 0fda1b1a33ae..41f8709abfc5 100644
@@ -1649,8 +1649,6 @@ static __cold void io_drain_req(struct io_kiocb *req)
 	struct io_ring_ctx *ctx = req->ctx;
 	bool drain = req->flags & IOSQE_IO_DRAIN;
 	struct io_defer_entry *de;
-	struct io_kiocb *tmp;
-	int nr = 0;
 
 	de = kmalloc(sizeof(*de), GFP_KERNEL_ACCOUNT);
 	if (!de) {
@@ -1658,8 +1656,6 @@ static __cold void io_drain_req(struct io_kiocb *req)
 		return;
 	}
 
-	io_for_each_link(tmp, req)
-		nr++;
 	io_prep_async_link(req);
 	trace_io_uring_defer(req);
 	de->req = req;
Signature · 1 line
2.49.0
maintainer
#1 lore raw
Quoted 10 lines · Pavel Begunkov

io_drain_req() uses a helper function for counting the number of requests in a link, remove unused open coded accounting that was accidentially left.

---

Should also be fine to squash into the original patch

Squashed, thanks.

Signature · 1 line
Jens Axboe