diff options
author | Bart Van Assche <bvanassche@acm.org> | 2019-09-30 16:00:46 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-10-07 08:32:08 -0600 |
commit | e29158b4fff7b582643dc020343d52773aaef0c1 (patch) | |
tree | 0bc1b2927432133981527ea9c1c0820d731c8618 /drivers/block | |
parent | da0c9ea146cbe92b832f1b0f694840ea8eb33cce (diff) | |
download | linux-e29158b4fff7b582643dc020343d52773aaef0c1.tar.gz linux-e29158b4fff7b582643dc020343d52773aaef0c1.tar.bz2 linux-e29158b4fff7b582643dc020343d52773aaef0c1.zip |
null_blk: Improve nullb_device_##NAME##_store() readability
Introduce a local variable to make the code easier to read. This patch
does not change any functionality but makes the next patch in this
series easier to read.
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/null_blk_main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c index 0e7da5015ccd..f5747cfd806f 100644 --- a/drivers/block/null_blk_main.c +++ b/drivers/block/null_blk_main.c @@ -274,10 +274,11 @@ static ssize_t \ nullb_device_##NAME##_store(struct config_item *item, const char *page, \ size_t count) \ { \ - if (test_bit(NULLB_DEV_FL_CONFIGURED, &to_nullb_device(item)->flags)) \ + struct nullb_device *dev = to_nullb_device(item); \ + \ + if (test_bit(NULLB_DEV_FL_CONFIGURED, &dev->flags)) \ return -EBUSY; \ - return nullb_device_##TYPE##_attr_store( \ - &to_nullb_device(item)->NAME, page, count); \ + return nullb_device_##TYPE##_attr_store(&dev->NAME, page, count); \ } \ CONFIGFS_ATTR(nullb_device_, NAME); |