]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
io_uring/poll: improve readability of poll reference decrementing
authorJens Axboe <axboe@kernel.dk>
Thu, 1 Feb 2024 19:49:37 +0000 (12:49 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 8 Feb 2024 20:27:06 +0000 (13:27 -0700)
This overly long line is hard to read. Break it up by AND'ing the
ref mask first, then perform the atomic_sub_return() with the value
itself.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/poll.c

index 3f3380dc5f68190176f6a4e686acac416945408a..8e01c2672df460791ab993e337dd1546490a8daf 100644 (file)
@@ -343,8 +343,8 @@ static int io_poll_check_events(struct io_kiocb *req, struct io_tw_state *ts)
                 * Release all references, retry if someone tried to restart
                 * task_work while we were executing it.
                 */
-       } while (atomic_sub_return(v & IO_POLL_REF_MASK, &req->poll_refs) &
-                                       IO_POLL_REF_MASK);
+               v &= IO_POLL_REF_MASK;
+       } while (atomic_sub_return(v, &req->poll_refs) & IO_POLL_REF_MASK);
 
        return IOU_POLL_NO_ACTION;
 }