diff options
author | Liu Xiang <[email protected]> | 2021-06-30 18:50:51 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2021-06-30 20:47:29 -0700 |
commit | d2155fe54ddb6e289b4f7854df5a7d828d6efbb5 (patch) | |
tree | 96900ba4918aa2c1b4ba1ca6d544bbfcb3b82020 | |
parent | 17adb230d6a6e39f9ba39440ee8441291795dff4 (diff) |
mm: compaction: remove duplicate !list_empty(&sublist) check
The list_splice_tail(&sublist, freelist) also do !list_empty(&sublist)
check, so remove the duplicate call.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Liu Xiang <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | mm/compaction.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index b7fb991dee1b..f27ea22f297a 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1297,8 +1297,7 @@ move_freelist_head(struct list_head *freelist, struct page *freepage) if (!list_is_last(freelist, &freepage->lru)) { list_cut_before(&sublist, freelist, &freepage->lru); - if (!list_empty(&sublist)) - list_splice_tail(&sublist, freelist); + list_splice_tail(&sublist, freelist); } } @@ -1315,8 +1314,7 @@ move_freelist_tail(struct list_head *freelist, struct page *freepage) if (!list_is_first(freelist, &freepage->lru)) { list_cut_position(&sublist, freelist, &freepage->lru); - if (!list_empty(&sublist)) - list_splice_tail(&sublist, freelist); + list_splice_tail(&sublist, freelist); } } |