Skip to content

Commit

Permalink
block: remove redundant mq check
Browse files Browse the repository at this point in the history
elv_support_iosched() will check queue_is_mq() for us. So, remove
the redundant check to clean code.

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 dd1c372 commit 6251b75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ int elevator_switch_mq(struct request_queue *q,

static inline bool elv_support_iosched(struct request_queue *q)
{
if (!q->mq_ops ||
if (!queue_is_mq(q) ||
(q->tag_set && (q->tag_set->flags & BLK_MQ_F_NO_SCHED)))
return false;
return true;
Expand Down Expand Up @@ -763,7 +763,7 @@ ssize_t elv_iosched_store(struct request_queue *q, const char *name,
{
int ret;

if (!queue_is_mq(q) || !elv_support_iosched(q))
if (!elv_support_iosched(q))
return count;

ret = __elevator_change(q, name);
Expand Down

0 comments on commit 6251b75

Please sign in to comment.