Skip to content

Commit 81475be

Browse files
johnpgarryaxboe
authored andcommitted
block: Drop NULL check in bdev_write_zeroes_sectors()
Function bdev_get_queue() must not return NULL, so drop the check in bdev_write_zeroes_sectors(). Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: John Garry <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Nitesh Shetty <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 64b582c commit 81475be

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

include/linux/blkdev.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,12 +1296,7 @@ bdev_max_secure_erase_sectors(struct block_device *bdev)
12961296

12971297
static inline unsigned int bdev_write_zeroes_sectors(struct block_device *bdev)
12981298
{
1299-
struct request_queue *q = bdev_get_queue(bdev);
1300-
1301-
if (q)
1302-
return q->limits.max_write_zeroes_sectors;
1303-
1304-
return 0;
1299+
return bdev_get_queue(bdev)->limits.max_write_zeroes_sectors;
13051300
}
13061301

13071302
static inline bool bdev_nonrot(struct block_device *bdev)

0 commit comments

Comments
 (0)