From: Cyrill Gorcunov Date: Tue, 6 Jan 2009 22:40:33 +0000 (-0800) Subject: mm: hugetlb: remove redundant `if' operation X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=91f47662dfaa5b459aebe13284c6c38db27350dc;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git mm: hugetlb: remove redundant `if' operation At this point we already know that 'addr' is not NULL so get rid of redundant 'if'. Probably gcc eliminate it by optimization pass. [akpm@linux-foundation.org: use __weak, too] Signed-off-by: Cyrill Gorcunov Reviewed-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 82321da23cc3..618e98304080 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1005,7 +1005,7 @@ static struct page *alloc_huge_page(struct vm_area_struct *vma, return page; } -__attribute__((weak)) int alloc_bootmem_huge_page(struct hstate *h) +int __weak alloc_bootmem_huge_page(struct hstate *h) { struct huge_bootmem_page *m; int nr_nodes = nodes_weight(node_online_map); @@ -1024,8 +1024,7 @@ __attribute__((weak)) int alloc_bootmem_huge_page(struct hstate *h) * puts them into the mem_map). */ m = addr; - if (m) - goto found; + goto found; } hstate_next_node(h); nr_nodes--;