[PATCH] mm/hugetlb: fix compile warning for !CONFIG_NUMA build

From: Feng Tang
Date: Mon Jul 19 2021 - 04:24:23 EST


Stephen Rothwell reported the i386 build with CONFIG_NUMA=n
will have a warning:

mm/hugetlb.c: In function 'dequeue_huge_page_vma':
mm/hugetlb.c:1180:1: warning: label 'check_reserve' defined but not used [-Wunused-label]
1180 | check_reserve:
| ^~~~~~~~~~~~~

introduced by commit
df178183cf05 ("mm/hugetlb: add support for mempolicy MPOL_PREFERRED_MANY")

Signed-off-by: Feng Tang <feng.tang@xxxxxxxxx>
---
mm/hugetlb.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index ae1a39e11bcf..528947da65c8 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1177,7 +1177,9 @@ static struct page *dequeue_huge_page_vma(struct hstate *h,
#endif
page = dequeue_huge_page_nodemask(h, gfp_mask, nid, nodemask);

+#ifdef CONFIG_NUMA
check_reserve:
+#endif
if (page && !avoid_reserve && vma_has_reserves(vma, chg)) {
SetHPageRestoreReserve(page);
h->resv_huge_pages--;
--
2.7.4


> --
> Cheers,
> Stephen Rothwell



--rwEMma7ioTxnRzrJ
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0001-mm-hugetlb-fix-compile-warning-for-CONFIG_NUMA-build.patch"