]> www.infradead.org Git - nvme.git/commitdiff
io_uring: remove checks for NULL 'sq_offset'
authorJens Axboe <axboe@kernel.dk>
Wed, 22 May 2024 17:13:44 +0000 (11:13 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 22 May 2024 17:13:44 +0000 (11:13 -0600)
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 <axboe@kernel.dk>
io_uring/io_uring.c

index 86fd72f6a1c2b6813ce40b9960075a5c26173085..816e93e7f94907144f0c6a2a1f12340aab8b55fa 100644 (file)
@@ -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)