summaryrefslogtreecommitdiffstats
path: root/io_uring/poll.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-02-01 20:49:37 +0100
committerJens Axboe <axboe@kernel.dk>2024-02-08 21:27:06 +0100
commit3cdc4be114a9be61b7041a53e44aa71718a7cf28 (patch)
tree4e007ceeaa5394b5f3bbe77de4fe21f6152c93d6 /io_uring/poll.c
parentio_uring: remove unconditional looping in local task_work handling (diff)
downloadlinux-3cdc4be114a9be61b7041a53e44aa71718a7cf28.tar.xz
linux-3cdc4be114a9be61b7041a53e44aa71718a7cf28.zip
io_uring/poll: improve readability of poll reference decrementing
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>
Diffstat (limited to 'io_uring/poll.c')
-rw-r--r--io_uring/poll.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io_uring/poll.c b/io_uring/poll.c
index 3f3380dc5f68..8e01c2672df4 100644
--- a/io_uring/poll.c
+++ b/io_uring/poll.c
@@ -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;
}