The variable capacity is used only in one place and so can be removed
and get_capacity(disk) used directly instead.

Signed-off-by: Damien Le Moal <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
---
 block/blk-zoned.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 39381f2b2e94..345a99c0b031 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -161,7 +161,6 @@ int blkdev_report_zones(struct block_device *bdev, sector_t 
sector,
                        unsigned int nr_zones, report_zones_cb cb, void *data)
 {
        struct gendisk *disk = bdev->bd_disk;
-       sector_t capacity = get_capacity(disk);
        struct disk_report_zones_cb_args args = {
                .disk = disk,
                .user_cb = cb,
@@ -171,7 +170,7 @@ int blkdev_report_zones(struct block_device *bdev, sector_t 
sector,
        if (!bdev_is_zoned(bdev) || WARN_ON_ONCE(!disk->fops->report_zones))
                return -EOPNOTSUPP;
 
-       if (!nr_zones || sector >= capacity)
+       if (!nr_zones || sector >= get_capacity(disk))
                return 0;
 
        return disk->fops->report_zones(disk, sector, nr_zones,
-- 
2.51.0


Reply via email to