All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <kch@nvidia.com>
To: <linux-block@vger.kernel.org>
Cc: <axboe@kernel.dk>, <ming.lei@redhat.com>, <damien.lemoal@wdc.com>,
	<jiangguoqing@kylinos.cn>, <shinichiro.kawasaki@wdc.com>,
	Chaitanya Kulkarni <kch@nvidia.com>
Subject: [PATCH 3/4] blk-lib: don't check bdev_get_queue() NULL check
Date: Mon, 14 Feb 2022 02:08:58 -0800	[thread overview]
Message-ID: <20220214100859.9400-4-kch@nvidia.com> (raw)
In-Reply-To: <20220214100859.9400-1-kch@nvidia.com>

Based on the comment present in the bdev_get_queue()
bdev->bd_disk->queue can never be NULL. Remove the NULL check for the
local variabel q that is set from bdev_get_queue() in the function
__blkdev_issue_write_zeroes() and the respective NULL check.

Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 block/blk-lib.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/block/blk-lib.c b/block/blk-lib.c
index 473888d667a1..e7a9ed8cc5df 100644
--- a/block/blk-lib.c
+++ b/block/blk-lib.c
@@ -244,10 +244,6 @@ static int __blkdev_issue_write_zeroes(struct block_device *bdev,
 {
 	struct bio *bio = *biop;
 	unsigned int max_write_zeroes_sectors;
-	struct request_queue *q = bdev_get_queue(bdev);
-
-	if (!q)
-		return -ENXIO;
 
 	if (bdev_read_only(bdev))
 		return -EPERM;
-- 
2.29.0


  parent reply	other threads:[~2022-02-14 10:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14 10:08 [PATCH 0/4] blk-lib: cleanup bdev_get_queue() Chaitanya Kulkarni
2022-02-14 10:08 ` [PATCH 1/4] blk-lib: don't check bdev_get_queue() NULL check Chaitanya Kulkarni
2022-02-14 10:08 ` [PATCH 2/4] " Chaitanya Kulkarni
2022-02-14 10:08 ` Chaitanya Kulkarni [this message]
2022-02-14 10:08 ` [PATCH 4/4] " Chaitanya Kulkarni
2022-02-14 10:19 ` [PATCH 0/4] blk-lib: cleanup bdev_get_queue() Chaitanya Kulkarni
2022-02-14 13:45   ` 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=20220214100859.9400-4-kch@nvidia.com \
    --to=kch@nvidia.com \
    --cc=axboe@kernel.dk \
    --cc=damien.lemoal@wdc.com \
    --cc=jiangguoqing@kylinos.cn \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=shinichiro.kawasaki@wdc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.