linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yufen Yu <yuyufen@huawei.com>
To: <axboe@kernel.dk>
Cc: <linux-block@vger.kernel.org>, <ming.lei@redhat.com>, <hch@lst.de>
Subject: [RESEND PATCH v2 2/7] block: remove redundant mq check
Date: Thu, 8 Oct 2020 23:26:28 -0400	[thread overview]
Message-ID: <20201009032633.83645-3-yuyufen@huawei.com> (raw)
In-Reply-To: <20201009032633.83645-1-yuyufen@huawei.com>

elv_support_iosched() will check queue_is_mq() for us. So, remove
the redundant check to clean code.

Signed-off-by: Yufen Yu <yuyufen@huawei.com>
---
 block/elevator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/elevator.c b/block/elevator.c
index 7d76b61e157a..b506895b34c7 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -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;
@@ -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);
-- 
2.25.4


  parent reply	other threads:[~2020-10-09  3:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09  3:26 [RESEND PATCH v2 0/7] some improvements and cleanups for block Yufen Yu
2020-10-09  3:26 ` [RESEND PATCH v2 1/7] block: invoke blk_mq_exit_sched no matter whether have .exit_sched Yufen Yu
2020-10-09  3:26 ` Yufen Yu [this message]
2020-10-09  3:26 ` [RESEND PATCH v2 3/7] block: use helper function to test queue register Yufen Yu
2020-10-09  3:26 ` [RESEND PATCH v2 4/7] blk-mq: use helper function to test hw stopped Yufen Yu
2020-10-09  3:26 ` [RESEND PATCH v2 5/7] block: fix comment and add lockdep assert Yufen Yu
2020-10-09  3:26 ` [RESEND PATCH v2 6/7] block: get rid of unnecessary local variable Yufen Yu
2020-10-09  3:26 ` [RESEND PATCH v2 7/7] blk-mq: get rid of the dead flush handle code path Yufen Yu
2020-10-09 18:45 ` [RESEND PATCH v2 0/7] some improvements and cleanups for block 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=20201009032633.83645-3-yuyufen@huawei.com \
    --to=yuyufen@huawei.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.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).