From: Bart Van Assche <bvanassche@acm.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Bart Van Assche <bvanassche@acm.org>,
Christoph Hellwig <hch@infradead.org>,
Ming Lei <ming.lei@redhat.com>, Hannes Reinecke <hare@suse.com>,
Johannes Thumshirn <jthumshirn@suse.de>
Subject: [PATCH 7/8] null_blk: Improve nullb_device_##NAME##_store() readability
Date: Mon, 30 Sep 2019 16:00:46 -0700 [thread overview]
Message-ID: <20190930230047.44113-8-bvanassche@acm.org> (raw)
In-Reply-To: <20190930230047.44113-1-bvanassche@acm.org>
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>
---
drivers/block/null_blk_main.c | 7 ++++---
1 file 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);
--
2.23.0.444.g18eeb5a265-goog
next prev parent reply other threads:[~2019-09-30 23:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-30 23:00 [PATCH 0/8] Block layer patches for kernel v5.5 Bart Van Assche
2019-09-30 23:00 ` [PATCH 1/8] block: Fix three kernel-doc warnings Bart Van Assche
2019-09-30 23:00 ` [PATCH 2/8] block: Fix writeback throttling W=1 compiler warnings Bart Van Assche
2019-09-30 23:00 ` [PATCH 3/8] block: Remove request_queue.nr_queues Bart Van Assche
2019-09-30 23:00 ` [PATCH 4/8] block: Remove "dying" checks from sysfs callbacks Bart Van Assche
2019-09-30 23:00 ` [PATCH 5/8] block: Reduce sysfs_lock locking inside blk_cleanup_queue() Bart Van Assche
2019-09-30 23:00 ` [PATCH 6/8] block: Document all members of blk_mq_tag_set and bkl_mq_queue_map Bart Van Assche
2019-09-30 23:00 ` Bart Van Assche [this message]
2019-09-30 23:00 ` [PATCH 8/8] null_blk: Enable modifying 'submit_queues' after an instance has been configured Bart Van Assche
2019-10-02 3:28 ` [PATCH 0/8] Block layer patches for kernel v5.5 Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190930230047.44113-8-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=axboe@kernel.dk \
--cc=hare@suse.com \
--cc=hch@infradead.org \
--cc=hch@lst.de \
--cc=jthumshirn@suse.de \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).