From: Xu Wang <vulab@iscas.ac.cn>
To: axboe@kernel.dk
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] blk-zoned: Remove needless request_queue NULL pointer checks
Date: Fri, 10 Sep 2021 02:23:38 +0000 [thread overview]
Message-ID: <20210910022338.22878-1-vulab@iscas.ac.cn> (raw)
The request_queue pointer returned from bdev_get_queue() shall
never be NULL, so the NULL checks are unnecessary, just remove them.
Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
block/blk-zoned.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 1d0c76c18fc5..5160972a009a 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -354,8 +354,6 @@ int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode,
return -EINVAL;
q = bdev_get_queue(bdev);
- if (!q)
- return -ENXIO;
if (!blk_queue_is_zoned(q))
return -ENOTTY;
@@ -412,8 +410,6 @@ int blkdev_zone_mgmt_ioctl(struct block_device *bdev, fmode_t mode,
return -EINVAL;
q = bdev_get_queue(bdev);
- if (!q)
- return -ENXIO;
if (!blk_queue_is_zoned(q))
return -ENOTTY;
--
2.17.1
next reply other threads:[~2021-09-10 2:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-10 2:23 Xu Wang [this message]
2021-09-10 2:41 ` [PATCH] blk-zoned: Remove needless request_queue NULL pointer checks Damien Le Moal
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=20210910022338.22878-1-vulab@iscas.ac.cn \
--to=vulab@iscas.ac.cn \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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