block: use helper function to test queue register

We have defined common interface blk_queue_registered() to
test QUEUE_FLAG_REGISTERED. Just use it.

Signed-off-by: Yufen Yu <yuyufen@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Yufen Yu 2020-10-08 23:26:29 -04:00 committed by Jens Axboe
parent 6251b754f5
commit 75e6c00fc7
2 changed files with 2 additions and 2 deletions

View File

@ -669,7 +669,7 @@ static struct ioc *q_to_ioc(struct request_queue *q)
static const char *q_name(struct request_queue *q)
{
if (test_bit(QUEUE_FLAG_REGISTERED, &q->queue_flags))
if (blk_queue_registered(q))
return kobject_name(q->kobj.parent);
else
return "<unknown>";

View File

@ -672,7 +672,7 @@ void elevator_init_mq(struct request_queue *q)
if (!elv_support_iosched(q))
return;
WARN_ON_ONCE(test_bit(QUEUE_FLAG_REGISTERED, &q->queue_flags));
WARN_ON_ONCE(blk_queue_registered(q));
if (unlikely(q->elevator))
return;