Skip to content

Commit e29158b

Browse files
bvanasscheaxboe
authored andcommitted
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>
1 parent da0c9ea commit e29158b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/block/null_blk_main.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,11 @@ static ssize_t \
274274
nullb_device_##NAME##_store(struct config_item *item, const char *page, \
275275
size_t count) \
276276
{ \
277-
if (test_bit(NULLB_DEV_FL_CONFIGURED, &to_nullb_device(item)->flags)) \
277+
struct nullb_device *dev = to_nullb_device(item); \
278+
\
279+
if (test_bit(NULLB_DEV_FL_CONFIGURED, &dev->flags)) \
278280
return -EBUSY; \
279-
return nullb_device_##TYPE##_attr_store( \
280-
&to_nullb_device(item)->NAME, page, count); \
281+
return nullb_device_##TYPE##_attr_store(&dev->NAME, page, count); \
281282
} \
282283
CONFIGFS_ATTR(nullb_device_, NAME);
283284

0 commit comments

Comments
 (0)