From: Xu Wang <vulab@iscas.ac.cn>
To: Damien.LeMoal@wdc.com, konrad.wilk@oracle.com,
roger.pau@citrix.com, axboe@kernel.dk,
xen-devel@lists.xenproject.org
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2] xen-blkback: Remove needless request_queue NULL pointer check
Date: Fri, 10 Sep 2021 03:59:18 +0000 [thread overview]
Message-ID: <20210910035918.24907-1-vulab@iscas.ac.cn> (raw)
The request_queue pointer returned from bdev_get_queue() shall
never be NULL, so the null check is unnecessary, just remove it.
Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
Changes since v2:
- Add missing parenthesis.
- Remove another null pointer check.
---
drivers/block/xen-blkback/xenbus.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index 33eba3df4dd9..aac08b4369ac 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -516,10 +516,10 @@ static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
vbd->type |= VDISK_REMOVABLE;
q = bdev_get_queue(bdev);
- if (q && test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (test_bit(QUEUE_FLAG_WC, &q->queue_flags))
vbd->flush_support = true;
- if (q && blk_queue_secure_erase(q))
+ if (blk_queue_secure_erase(q))
vbd->discard_secure = true;
vbd->feature_gnt_persistent = feature_persistent;
--
2.17.1
next reply other threads:[~2021-09-10 3:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-10 3:59 Xu Wang [this message]
2021-09-14 7:58 ` [PATCH v2] xen-blkback: Remove needless request_queue NULL pointer check Roger Pau Monné
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=20210910035918.24907-1-vulab@iscas.ac.cn \
--to=vulab@iscas.ac.cn \
--cc=Damien.LeMoal@wdc.com \
--cc=axboe@kernel.dk \
--cc=konrad.wilk@oracle.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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).