io_uring: remove unnecessary variable
authorDylan Yudaken <dylany@fb.com>
Tue, 30 Aug 2022 12:50:07 +0000 (05:50 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 21 Sep 2022 16:30:42 +0000 (10:30 -0600)
'running' is set once and read once, so can easily just remove it

Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220830125013.570060-2-dylany@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c

index b9640ad..b328805 100644 (file)
@@ -1052,12 +1052,9 @@ void io_req_task_work_add(struct io_kiocb *req)
        struct io_uring_task *tctx = req->task->io_uring;
        struct io_ring_ctx *ctx = req->ctx;
        struct llist_node *node;
-       bool running;
-
-       running = !llist_add(&req->io_task_work.node, &tctx->task_list);
 
        /* task_work already pending, we're done */
-       if (running)
+       if (!llist_add(&req->io_task_work.node, &tctx->task_list))
                return;
 
        if (ctx->flags & IORING_SETUP_TASKRUN_FLAG)