diff mbox series

[v2,2/2] block: Drop NULL check in bdev_write_zeroes_sectors()

Message ID 20240815163228.216051-3-john.g.garry@oracle.com (mailing list archive)
State New, archived
Headers show
Series block: Fix __blkdev_issue_write_zeroes() limit handling | expand

Commit Message

John Garry Aug. 15, 2024, 4:32 p.m. UTC
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>
---
 include/linux/blkdev.h | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Martin K. Petersen Aug. 15, 2024, 5:43 p.m. UTC | #1
John,

> Function bdev_get_queue() must not return NULL, so drop the check in
> bdev_write_zeroes_sectors().

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Nitesh Shetty Aug. 19, 2024, 3:16 p.m. UTC | #2
On 15/08/24 04:32PM, John Garry wrote:
>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: Nitesh Shetty <nj.shetty@samsung.com>
diff mbox series

Patch

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index e85ec73a07d5..b7664d593486 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -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)