Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: cleanup blkdev_report_zones()

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 <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Damien Le Moal and committed by
Jens Axboe
e8ecb21f bba4322e

+1 -2
+1 -2
block/blk-zoned.c
··· 161 161 unsigned int nr_zones, report_zones_cb cb, void *data) 162 162 { 163 163 struct gendisk *disk = bdev->bd_disk; 164 - sector_t capacity = get_capacity(disk); 165 164 struct disk_report_zones_cb_args args = { 166 165 .disk = disk, 167 166 .user_cb = cb, ··· 170 171 if (!bdev_is_zoned(bdev) || WARN_ON_ONCE(!disk->fops->report_zones)) 171 172 return -EOPNOTSUPP; 172 173 173 - if (!nr_zones || sector >= capacity) 174 + if (!nr_zones || sector >= get_capacity(disk)) 174 175 return 0; 175 176 176 177 return disk->fops->report_zones(disk, sector, nr_zones,