Skip to content

Commit

Permalink
block: use helper function to test queue register
Browse files Browse the repository at this point in the history
We have defined common interface blk_queue_registered() to
test QUEUE_FLAG_REGISTERED. Just use it.

Signed-off-by: Yufen Yu <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Yufen Yu authored and axboe committed Oct 9, 2020
1 parent 6251b75 commit 75e6c00
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion block/blk-iocost.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>";
Expand Down
2 changes: 1 addition & 1 deletion block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 75e6c00

Please sign in to comment.