summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorYufen Yu <yuyufen@huawei.com>2020-10-08 23:26:32 -0400
committerJens Axboe <axboe@kernel.dk>2020-10-09 12:34:06 -0600
commit0546858c59fb90122ca8c820e6aa221925a13bd8 (patch)
tree7666ed621ff7392017b51cf98946df76294c8d4e /block
parentf0c6ae09db1d39cbcf35776f889e0f7f861493d2 (diff)
downloadlinux-stable-0546858c59fb90122ca8c820e6aa221925a13bd8.tar.gz
linux-stable-0546858c59fb90122ca8c820e6aa221925a13bd8.tar.bz2
linux-stable-0546858c59fb90122ca8c820e6aa221925a13bd8.zip
block: get rid of unnecessary local variable
Since whole elevator register is protectd by sysfs_lock, we don't need extras 'has_elevator'. Just use q->elevator directly. Signed-off-by: Yufen Yu <yuyufen@huawei.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-sysfs.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index e35eb1a05ad2..bdc8cf575654 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -833,7 +833,6 @@ int blk_register_queue(struct gendisk *disk)
int ret;
struct device *dev = disk_to_dev(disk);
struct request_queue *q = disk->queue;
- bool has_elevator = false;
if (WARN_ON(!q))
return -ENXIO;
@@ -899,7 +898,6 @@ int blk_register_queue(struct gendisk *disk)
kobject_put(&dev->kobj);
return ret;
}
- has_elevator = true;
}
blk_queue_flag_set(QUEUE_FLAG_REGISTERED, q);
@@ -908,7 +906,7 @@ int blk_register_queue(struct gendisk *disk)
/* Now everything is ready and send out KOBJ_ADD uevent */
kobject_uevent(&q->kobj, KOBJ_ADD);
- if (has_elevator)
+ if (q->elevator)
kobject_uevent(&q->elevator->kobj, KOBJ_ADD);
mutex_unlock(&q->sysfs_lock);