Skip to content

Commit 003f242

Browse files
committed
io_uring: get rid of unnecessary 'length' variable
Just use the ARRAY_SIZE directly, we don't use length for anything else in this function. Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent d86eaed commit 003f242

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

io_uring/io_uring.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -941,16 +941,13 @@ bool io_aux_cqe(const struct io_kiocb *req, bool defer, s32 res, u32 cflags,
941941
struct io_ring_ctx *ctx = req->ctx;
942942
u64 user_data = req->cqe.user_data;
943943
struct io_uring_cqe *cqe;
944-
unsigned int length;
945944

946945
if (!defer)
947946
return __io_post_aux_cqe(ctx, user_data, res, cflags, allow_overflow);
948947

949-
length = ARRAY_SIZE(ctx->submit_state.cqes);
950-
951948
lockdep_assert_held(&ctx->uring_lock);
952949

953-
if (ctx->submit_state.cqes_count == length) {
950+
if (ctx->submit_state.cqes_count == ARRAY_SIZE(ctx->submit_state.cqes)) {
954951
__io_cq_lock(ctx);
955952
__io_flush_post_cqes(ctx);
956953
/* no need to flush - flush is deferred */

0 commit comments

Comments
 (0)