summaryrefslogtreecommitdiff
path: root/io_uring
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-06-08 00:00:07 +0300
committerJens Axboe <axboe@kernel.dk>2023-06-08 00:00:07 +0300
commit003f242b0dc16b287e6d15833d1d7f4adfa346ff (patch)
tree04e269ad039418cdfedc929a6fd36608da71312b /io_uring
parentd86eaed185e9c6052d1ee2ca538f1936ff255887 (diff)
downloadlinux-003f242b0dc16b287e6d15833d1d7f4adfa346ff.tar.xz
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>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/io_uring.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 08574a86da72..a467064da1af 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -941,16 +941,13 @@ bool io_aux_cqe(const struct io_kiocb *req, bool defer, s32 res, u32 cflags,
struct io_ring_ctx *ctx = req->ctx;
u64 user_data = req->cqe.user_data;
struct io_uring_cqe *cqe;
- unsigned int length;
if (!defer)
return __io_post_aux_cqe(ctx, user_data, res, cflags, allow_overflow);
- length = ARRAY_SIZE(ctx->submit_state.cqes);
-
lockdep_assert_held(&ctx->uring_lock);
- if (ctx->submit_state.cqes_count == length) {
+ if (ctx->submit_state.cqes_count == ARRAY_SIZE(ctx->submit_state.cqes)) {
__io_cq_lock(ctx);
__io_flush_post_cqes(ctx);
/* no need to flush - flush is deferred */