Skip to content

Commit

Permalink
io_uring/poll: improve readability of poll reference decrementing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Axboe committed Feb 8, 2024
1 parent 9fe3eae commit 3cdc4be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions io_uring/poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3cdc4be

Please sign in to comment.