diff mbox series

[1/3] null_blk: Do not set disk->nr_zones

Message ID 20240621031506.759397-2-dlemoal@kernel.org (mailing list archive)
State New, archived
Headers show
Series Cleanup blkdev zone helpers | expand

Commit Message

Damien Le Moal June 21, 2024, 3:15 a.m. UTC
In null_register_zoned_dev(), there is no need to set disk->nr_zones as
the now uncoditional call to blk_revalidate_disk_zones() will do that.
So remove the assignment using bdev_nr_zones().

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
 drivers/block/null_blk/zoned.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Christoph Hellwig June 21, 2024, 5:14 a.m. UTC | #1
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Johannes Thumshirn June 21, 2024, 10:41 a.m. UTC | #2
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
diff mbox series

Patch

diff --git a/drivers/block/null_blk/zoned.c b/drivers/block/null_blk/zoned.c
index b42c00f13132..9f7151ad93cf 100644
--- a/drivers/block/null_blk/zoned.c
+++ b/drivers/block/null_blk/zoned.c
@@ -171,8 +171,6 @@  int null_register_zoned_dev(struct nullb *nullb)
 	struct request_queue *q = nullb->q;
 	struct gendisk *disk = nullb->disk;
 
-	disk->nr_zones = bdev_nr_zones(disk->part0);
-
 	pr_info("%s: using %s zone append\n",
 		disk->disk_name,
 		queue_emulates_zone_append(q) ? "emulated" : "native");