Skip to content

Commit

Permalink
block: Drop NULL check in bdev_write_zeroes_sectors()
Browse files Browse the repository at this point in the history
Function bdev_get_queue() must not return NULL, so drop the check in
bdev_write_zeroes_sectors().

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>
Link: https://lore.kernel.org/r/20240815163228.216051-3-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
John Garry authored and Jens Axboe committed Aug 19, 2024
1 parent 64b582c commit 81475be
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -1296,12 +1296,7 @@ bdev_max_secure_erase_sectors(struct block_device *bdev)

static inline unsigned int bdev_write_zeroes_sectors(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);

if (q)
return q->limits.max_write_zeroes_sectors;

return 0;
return bdev_get_queue(bdev)->limits.max_write_zeroes_sectors;
}

static inline bool bdev_nonrot(struct block_device *bdev)
Expand Down

0 comments on commit 81475be

Please sign in to comment.