[PATCH v2 1/3] block: remove superfluous check for request queue in bdev_is_zoned()

Pankaj Raghav p.raghav at samsung.com
Tue Jan 10 06:36:33 PST 2023


Remove the superfluous request queue check in bdev_is_zoned() as
bdev_get_queue() can never return NULL.

Reviewed-by: Christoph Hellwig <hch at lst.de>
Reviewed-by: Damien Le Moal <damien.lemoal at opensource.wdc.com>
Reviewed-by: Bart Van Assche <bvanassche at acm.org>
Reviewed-by: Chaitanya Kulkarni <kch at nvidia.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn at wdc.com>
Signed-off-by: Pankaj Raghav <p.raghav at samsung.com>
---
 include/linux/blkdev.h | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index b87ed829ab94..0956bc0fb5b0 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1285,12 +1285,7 @@ static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
 
 static inline bool bdev_is_zoned(struct block_device *bdev)
 {
-	struct request_queue *q = bdev_get_queue(bdev);
-
-	if (q)
-		return blk_queue_is_zoned(q);
-
-	return false;
+	return blk_queue_is_zoned(bdev_get_queue(bdev));
 }
 
 static inline bool bdev_op_is_zoned_write(struct block_device *bdev,
-- 
2.25.1




More information about the Linux-nvme mailing list