null_blk: use available 'dev' in nullb_device_power_store()

We already have this pointer, no need to use to_nullb_device()
again.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Jens Axboe 2017-08-28 15:06:31 -06:00
parent 060fd198a3
commit b3c3051220

View file

@ -375,7 +375,7 @@ static ssize_t nullb_device_power_store(struct config_item *item,
set_bit(NULLB_DEV_FL_CONFIGURED, &dev->flags);
dev->power = newp;
} else if (to_nullb_device(item)->power && !newp) {
} else if (dev->power && !newp) {
mutex_lock(&lock);
dev->power = newp;
null_del_dev(dev->nullb);