The patch titled Subject: mm/hmm.c: suppress compilation warnings when CONFIG_HUGETLB_PAGE is not set has been added to the -mm tree. Its filename is hmm-suppress-compilation-warnings-when-config_hugetlb_page-is-not-set.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/hmm-suppress-compilation-warnings-when-config_hugetlb_page-is-not-set.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/hmm-suppress-compilation-warnings-when-config_hugetlb_page-is-not-set.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Jason Gunthorpe <jgg@xxxxxxxxxxxx> Subject: mm/hmm.c: suppress compilation warnings when CONFIG_HUGETLB_PAGE is not set gcc reports that several variables are defined but not used. For the first hunk CONFIG_HUGETLB_PAGE the entire if block is already protected by pud_huge() which is forced to 0. None of the stuff under the ifdef causes compilation problems as it is already stubbed out in the header files. For the second hunk the dummy huge_page_shift macro doesn't touch the argument, so just inline the argument. Link: http://lkml.kernel.org/r/20190522195151.GA23955@xxxxxxxx Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/hmm.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) --- a/mm/hmm.c~hmm-suppress-compilation-warnings-when-config_hugetlb_page-is-not-set +++ a/mm/hmm.c @@ -797,7 +797,6 @@ again: return hmm_vma_walk_hole_(addr, end, fault, write_fault, walk); -#ifdef CONFIG_HUGETLB_PAGE pfn = pud_pfn(pud) + ((addr & ~PUD_MASK) >> PAGE_SHIFT); for (i = 0; i < npages; ++i, ++pfn) { hmm_vma_walk->pgmap = get_dev_pagemap(pfn, @@ -813,9 +812,6 @@ again: } hmm_vma_walk->last = end; return 0; -#else - return -EINVAL; -#endif } split_huge_pud(walk->vma, pudp, addr); @@ -1024,9 +1020,8 @@ long hmm_range_snapshot(struct hmm_range return -EFAULT; if (is_vm_hugetlb_page(vma)) { - struct hstate *h = hstate_vma(vma); - - if (huge_page_shift(h) != range->page_shift && + if (huge_page_shift(hstate_vma(vma)) != + range->page_shift && range->page_shift != PAGE_SHIFT) return -EINVAL; } else { _ Patches currently in -mm which might be from jgg@xxxxxxxxxxxx are hmm-suppress-compilation-warnings-when-config_hugetlb_page-is-not-set.patch