dm cache: remove needless request_queue NULL pointer checks
authorXu Wang <vulab@iscas.ac.cn>
Fri, 19 Mar 2021 08:16:28 +0000 (08:16 +0000)
committerMike Snitzer <snitzer@redhat.com>
Fri, 26 Mar 2021 18:53:42 +0000 (14:53 -0400)
Since commit ff9ea323816d ("block, bdi: an active gendisk always has a
request_queue associated with it") the request_queue pointer returned
from bdev_get_queue() shall never be NULL.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-cache-target.c

index 541c450..6ab01ff 100644 (file)
@@ -3387,7 +3387,7 @@ static bool origin_dev_supports_discard(struct block_device *origin_bdev)
 {
        struct request_queue *q = bdev_get_queue(origin_bdev);
 
-       return q && blk_queue_discard(q);
+       return blk_queue_discard(q);
 }
 
 /*