From 2116274af46b12df7cea1dc5698f3cf2f231f8a9 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 4 Nov 2021 18:20:37 +0100 Subject: [PATCH] block: add a loff_t cast to bdev_nr_bytes Not really needed as both loff_t and sector_t are always 64-bits wide, but this documents the different types a bit better. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211104172037.531803-1-hch@lst.de Signed-off-by: Jens Axboe --- include/linux/genhd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 900325aa5d316..1dce769c45966 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -243,7 +243,7 @@ static inline sector_t bdev_nr_sectors(struct block_device *bdev) static inline loff_t bdev_nr_bytes(struct block_device *bdev) { - return bdev_nr_sectors(bdev) << SECTOR_SHIFT; + return (loff_t)bdev_nr_sectors(bdev) << SECTOR_SHIFT; } static inline sector_t get_capacity(struct gendisk *disk) -- 2.30.2