Skip to content

Commit

Permalink
io_uring: clean up io_lockdep_assert_cq_locked
Browse files Browse the repository at this point in the history
Move CONFIG_PROVE_LOCKING checks inside of io_lockdep_assert_cq_locked()
and kill the else branch.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Tested-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/bbf33c429c9f6d7207a8fe66d1a5866ec2c99850.1710799188.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Pavel Begunkov authored and Jens Axboe committed Apr 15, 2024
1 parent 0667db1 commit c133b3b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions io_uring/io_uring.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ enum {
void io_eventfd_ops(struct rcu_head *rcu);
void io_activate_pollwq(struct io_ring_ctx *ctx);

#if defined(CONFIG_PROVE_LOCKING)
static inline void io_lockdep_assert_cq_locked(struct io_ring_ctx *ctx)
{
#if defined(CONFIG_PROVE_LOCKING)
lockdep_assert(in_task());

if (ctx->flags & IORING_SETUP_IOPOLL) {
Expand All @@ -140,12 +140,8 @@ static inline void io_lockdep_assert_cq_locked(struct io_ring_ctx *ctx)
else
lockdep_assert(current == ctx->submitter_task);
}
}
#else
static inline void io_lockdep_assert_cq_locked(struct io_ring_ctx *ctx)
{
}
#endif
}

static inline void io_req_task_work_add(struct io_kiocb *req)
{
Expand Down

0 comments on commit c133b3b

Please sign in to comment.