aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-12-04 09:17:41 -0700
committerJens Axboe <axboe@kernel.dk>2019-12-04 09:17:41 -0700
commitbca1c43cb2dbe4212aea0793bfd91aeb4c2d184d (patch)
treea4cd5ab0115462b6a6325c3676968fd9689f6387 /drivers
parentbrd: warn on un-aligned buffer (diff)
downloadlinux-dev-bca1c43cb2dbe4212aea0793bfd91aeb4c2d184d.tar.xz
linux-dev-bca1c43cb2dbe4212aea0793bfd91aeb4c2d184d.zip
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: 979d54475e0b ("null_blk: cleanup null_gendisk_register") Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/null_blk_main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c
index 997b7dc095b9..ae8d4bc532b0 100644
--- a/drivers/block/null_blk_main.c
+++ b/drivers/block/null_blk_main.c
@@ -1561,7 +1561,6 @@ static int null_gendisk_register(struct nullb *nullb)
{
sector_t size = ((sector_t)nullb->dev->size * SZ_1M) >> SECTOR_SHIFT;
struct gendisk *disk;
- int ret;
disk = nullb->disk = alloc_disk_node(1, nullb->dev->home_node);
if (!disk)
@@ -1579,7 +1578,7 @@ static int null_gendisk_register(struct nullb *nullb)
#ifdef CONFIG_BLK_DEV_ZONED
if (nullb->dev->zoned) {
if (queue_is_mq(nullb->q)) {
- ret = blk_revalidate_disk_zones(disk);
+ int ret = blk_revalidate_disk_zones(disk);
if (ret)
return ret;
} else {