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 variable q that is set from bdev_get_queue() in the function __blkdev_issue_discard(). Signed-off-by: Chaitanya Kulkarni <kch@xxxxxxxxxx> --- block/blk-lib.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/block/blk-lib.c b/block/blk-lib.c index 9f09beadcbe3..08ac56eb3a70 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -32,9 +32,6 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector, unsigned int op; sector_t bs_mask, part_offset = 0; - if (!q) - return -ENXIO; - if (bdev_read_only(bdev)) return -EPERM; -- 2.29.0