mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
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>
This commit is contained in:
parent
17adb230d6
commit
d2155fe54d
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user