Skip to content

Commit

Permalink
mm/memory.c: mark create_huge_pmd() inline to prevent build failure
Browse files Browse the repository at this point in the history
With gcc 4.1.2:

    mm/memory.o: In function `create_huge_pmd':
    memory.c:(.text+0x93e): undefined reference to `do_huge_pmd_anonymous_page'

Interestingly, create_huge_pmd() is emitted in the assembler output, but
never called.

Converting transparent_hugepage_enabled() from a macro to a static
inline function reduced the ability of the compiler to remove unused
code.

Fix this by marking create_huge_pmd() inline.

Fixes: 16981d7 ("mm: improve readability of transparent_hugepage_enabled()")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Geert Uytterhoeven <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
geertu authored and torvalds committed Jul 12, 2017
1 parent c7acec7 commit 91a9014
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -3591,7 +3591,7 @@ static int do_numa_page(struct vm_fault *vmf)
return 0;
}

static int create_huge_pmd(struct vm_fault *vmf)
static inline int create_huge_pmd(struct vm_fault *vmf)
{
if (vma_is_anonymous(vmf->vma))
return do_huge_pmd_anonymous_page(vmf);
Expand Down

0 comments on commit 91a9014

Please sign in to comment.