static void io_wqe_enqueue(struct io_wqe *wqe, struct io_wq_work *work)
 {
        struct io_wqe_acct *acct = io_work_get_acct(wqe, work);
-       int work_flags;
+       bool do_wake;
 
        /*
         * If io-wq is exiting for this task, or if the request has explicitly
                return;
        }
 
-       work_flags = work->flags;
        raw_spin_lock(&wqe->lock);
        io_wqe_insert_work(wqe, work);
        wqe->flags &= ~IO_WQE_FLAG_STALLED;
+       do_wake = (work->flags & IO_WQ_WORK_CONCURRENT) ||
+                       !atomic_read(&acct->nr_running);
        raw_spin_unlock(&wqe->lock);
 
-       if ((work_flags & IO_WQ_WORK_CONCURRENT) ||
-           !atomic_read(&acct->nr_running))
+       if (do_wake)
                io_wqe_wake_worker(wqe, acct);
 }