Commit bca1c43c authored by Jens Axboe's avatar Jens Axboe

null_blk: remove unused variable warning on !CONFIG_BLK_DEV_ZONED

If BLK_DEV_ZONED isn't set, 'ret' isn't used. This makes gcc complain,
rightfully. Move ret where it is used.

Fixes: 979d5447 ("null_blk: cleanup null_gendisk_register")
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent f1acbf21
...@@ -1561,7 +1561,6 @@ static int null_gendisk_register(struct nullb *nullb) ...@@ -1561,7 +1561,6 @@ static int null_gendisk_register(struct nullb *nullb)
{ {
sector_t size = ((sector_t)nullb->dev->size * SZ_1M) >> SECTOR_SHIFT; sector_t size = ((sector_t)nullb->dev->size * SZ_1M) >> SECTOR_SHIFT;
struct gendisk *disk; struct gendisk *disk;
int ret;
disk = nullb->disk = alloc_disk_node(1, nullb->dev->home_node); disk = nullb->disk = alloc_disk_node(1, nullb->dev->home_node);
if (!disk) if (!disk)
...@@ -1579,7 +1578,7 @@ static int null_gendisk_register(struct nullb *nullb) ...@@ -1579,7 +1578,7 @@ static int null_gendisk_register(struct nullb *nullb)
#ifdef CONFIG_BLK_DEV_ZONED #ifdef CONFIG_BLK_DEV_ZONED
if (nullb->dev->zoned) { if (nullb->dev->zoned) {
if (queue_is_mq(nullb->q)) { if (queue_is_mq(nullb->q)) {
ret = blk_revalidate_disk_zones(disk); int ret = blk_revalidate_disk_zones(disk);
if (ret) if (ret)
return ret; return ret;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment