Commit 363dc512 authored by Xu Wang's avatar Xu Wang Committed by Linus Torvalds

mm/swapfile: remove needless request_queue NULL pointer check

The request_queue pointer returned from bdev_get_queue() shall never be
NULL, so the null check is unnecessary, just remove it.

Link: https://lkml.kernel.org/r/20210917082111.33923-1-vulab@iscas.ac.cnSigned-off-by: default avatarXu Wang <vulab@iscas.ac.cn>
Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 20b7fee7
...@@ -3118,7 +3118,7 @@ static bool swap_discardable(struct swap_info_struct *si) ...@@ -3118,7 +3118,7 @@ static bool swap_discardable(struct swap_info_struct *si)
{ {
struct request_queue *q = bdev_get_queue(si->bdev); struct request_queue *q = bdev_get_queue(si->bdev);
if (!q || !blk_queue_discard(q)) if (!blk_queue_discard(q))
return false; return false;
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment