From: Joonsoo Kim Date: Wed, 11 Sep 2013 21:21:02 +0000 (-0700) Subject: mm, hugetlb: remove redundant list_empty check in gather_surplus_pages() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c0d934ba278935fa751057091fe4a7c02d814f68;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: Joonsoo Kim Acked-by: Michal Hocko Reviewed-by: Wanpeng Li Reviewed-by: Aneesh Kumar K.V Acked-by: Hillf 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: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 08b7595fe3c1..a13be48b818b 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1037,11 +1037,8 @@ free: spin_unlock(&hugetlb_lock); /* Free unnecessary surplus pages to the buddy allocator */ - if (!list_empty(&surplus_list)) { - list_for_each_entry_safe(page, tmp, &surplus_list, lru) { - put_page(page); - } - } + list_for_each_entry_safe(page, tmp, &surplus_list, lru) + put_page(page); spin_lock(&hugetlb_lock); return ret;