From: Yufen Yu Date: Fri, 9 Oct 2020 03:26:29 +0000 (-0400) Subject: block: use helper function to test queue register X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=75e6c00fc75c53577bfc4831d909162c56e799ce;p=uclinux-h8%2Flinux.git 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 Signed-off-by: Jens Axboe --- diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 951ad4bb27f5..bbe86d1199dc 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -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 ""; diff --git a/block/elevator.c b/block/elevator.c index b506895b34c7..431a2a1c896e 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -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;