Commit c0d934ba authored by Joonsoo Kim's avatar Joonsoo Kim Committed by Linus Torvalds
Browse files

mm, hugetlb: remove redundant list_empty check in gather_surplus_pages()

If list is empty, list_for_each_entry_safe() doesn't do anything.  So,
this check is redundant.  Remove it.
Signed-off-by: default avatarJoonsoo Kim <>
Acked-by: default avatarMichal Hocko <>
Reviewed-by: default avatarWanpeng Li <>
Reviewed-by: default avatarAneesh Kumar K.V <>
Acked-by: default avatarHillf Danton <>
Cc: Naoya Horiguchi <>
Cc: Wanpeng Li <>
Cc: Rik van Riel <>
Cc: Mel Gorman <>
Cc: "Aneesh Kumar K.V" <>
Cc: KAMEZAWA Hiroyuki <>
Cc: Hugh Dickins <>
Cc: Davidlohr Bueso <>
Cc: David Gibson <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent b2261026
......@@ -1037,11 +1037,8 @@ static int gather_surplus_pages(struct hstate *h, int delta)
/* Free unnecessary surplus pages to the buddy allocator */
if (!list_empty(&surplus_list)) {
list_for_each_entry_safe(page, tmp, &surplus_list, lru) {
list_for_each_entry_safe(page, tmp, &surplus_list, lru)
return ret;
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