projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
17adb23
)
mm: compaction: remove duplicate !list_empty(&sublist) check
author
Liu Xiang
<liu.xiang@zlingsmart.com>
Thu, 1 Jul 2021 01:50:51 +0000
(18:50 -0700)
committer
Linus Torvalds
<torvalds@linux-foundation.org>
Thu, 1 Jul 2021 03:47:29 +0000
(20:47 -0700)
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>
mm/compaction.c
patch
|
blob
|
history
diff --git
a/mm/compaction.c
b/mm/compaction.c
index b7fb991dee1bc7b41ec2e27dba7c2cdcabbf4de4..f27ea22f297a8b9dd75e2c47c1e9c2b8c7868016 100644
(file)
--- 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);
}
}