Skip to content

Commit

Permalink
io_uring: remove checks for NULL 'sq_offset'
Browse files Browse the repository at this point in the history
Since the 5.12 kernel release, nobody has been passing NULL as the
sq_offset pointer. Remove the checks for it being NULL or not, it will
always be valid.

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed May 22, 2024
1 parent d13ddd9 commit 547988a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions io_uring/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -2597,13 +2597,11 @@ static unsigned long rings_size(struct io_ring_ctx *ctx, unsigned int sq_entries
#endif

if (ctx->flags & IORING_SETUP_NO_SQARRAY) {
if (sq_offset)
*sq_offset = SIZE_MAX;
*sq_offset = SIZE_MAX;
return off;
}

if (sq_offset)
*sq_offset = off;
*sq_offset = off;

sq_array_size = array_size(sizeof(u32), sq_entries);
if (sq_array_size == SIZE_MAX)
Expand Down

0 comments on commit 547988a

Please sign in to comment.