Commit e29158b4 authored by Bart Van Assche's avatar Bart Van Assche Committed by Jens Axboe

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: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent da0c9ea1
...@@ -274,10 +274,11 @@ static ssize_t \ ...@@ -274,10 +274,11 @@ static ssize_t \
nullb_device_##NAME##_store(struct config_item *item, const char *page, \ nullb_device_##NAME##_store(struct config_item *item, const char *page, \
size_t count) \ 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 -EBUSY; \
return nullb_device_##TYPE##_attr_store( \ return nullb_device_##TYPE##_attr_store(&dev->NAME, page, count); \
&to_nullb_device(item)->NAME, page, count); \
} \ } \
CONFIGFS_ATTR(nullb_device_, NAME); CONFIGFS_ATTR(nullb_device_, NAME);
......
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