summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiu Xiang <liu.xiang@zlingsmart.com>2021-06-30 18:50:51 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-06-30 20:47:29 -0700
commitd2155fe54ddb6e289b4f7854df5a7d828d6efbb5 (patch)
tree96900ba4918aa2c1b4ba1ca6d544bbfcb3b82020
parent17adb230d6a6e39f9ba39440ee8441291795dff4 (diff)
downloadlinux-stable-d2155fe54ddb6e289b4f7854df5a7d828d6efbb5.tar.gz
linux-stable-d2155fe54ddb6e289b4f7854df5a7d828d6efbb5.tar.bz2
linux-stable-d2155fe54ddb6e289b4f7854df5a7d828d6efbb5.zip
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/20210609095409.19920-1-liu.xiang@zlingsmart.com Signed-off-by: Liu Xiang <liu.xiang@zlingsmart.com> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/compaction.c6
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);
}
}