Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/mm: make hugetlbpage.c depend on CONFIG_HUGETLB_PAGE

The only function in hugetlbpage.c which doesn't depend on
CONFIG_HUGETLB_PAGE is gup_hugepte(), and this function is
only called from gup_huge_pd() which depends on
CONFIG_HUGETLB_PAGE so all the content of hugetlbpage.c
depends on CONFIG_HUGETLB_PAGE.

This patch modifies Makefile to only compile hugetlbpage.c
when CONFIG_HUGETLB_PAGE is set.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Christophe Leroy and committed by
Michael Ellerman
b7dcf96c 0caed4de

+1 -6
+1 -1
arch/powerpc/mm/Makefile
··· 15 15 obj-$(CONFIG_PPC32) += pgtable-frag.o 16 16 obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o 17 17 obj-$(CONFIG_PPC_MM_SLICES) += slice.o 18 - obj-y += hugetlbpage.o 18 + obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o 19 19 obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o 20 20 obj-$(CONFIG_HIGHMEM) += highmem.o 21 21 obj-$(CONFIG_PPC_COPRO_BASE) += copro_fault.o
-5
arch/powerpc/mm/hugetlbpage.c
··· 26 26 #include <asm/hugetlb.h> 27 27 #include <asm/pte-walk.h> 28 28 29 - 30 - #ifdef CONFIG_HUGETLB_PAGE 31 - 32 29 #define PAGE_SHIFT_64K 16 33 30 #define PAGE_SHIFT_512K 19 34 31 #define PAGE_SHIFT_8M 23 ··· 750 753 } 751 754 } 752 755 } 753 - 754 - #endif /* CONFIG_HUGETLB_PAGE */ 755 756 756 757 int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr, 757 758 unsigned long end, int write, struct page **pages, int *nr)