Skip to content

Commit d8c3f24

Browse files
committed
powerpc/mm: Fix build failures due to arch_reserved_kernel_pages()
With NUMA=n and FA_DUMP=y or PRESERVE_FA_DUMP=y the build fails with: arch/powerpc/kernel/fadump.c:1739:22: error: no previous prototype for ‘arch_reserved_kernel_pages’ [-Werror=missing-prototypes] 1739 | unsigned long __init arch_reserved_kernel_pages(void) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ The prototype for arch_reserved_kernel_pages() is in include/linux/mm.h, but it's guarded by __HAVE_ARCH_RESERVED_KERNEL_PAGES. The powerpc headers define __HAVE_ARCH_RESERVED_KERNEL_PAGES in asm/mmzone.h, which is not included into the generic headers when NUMA=n. Move the definition of __HAVE_ARCH_RESERVED_KERNEL_PAGES into asm/mmu.h which is included regardless of NUMA=n. Additionally the ifdef around __HAVE_ARCH_RESERVED_KERNEL_PAGES needs to also check for CONFIG_PRESERVE_FA_DUMP. Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
1 parent ede66cd commit d8c3f24

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

arch/powerpc/include/asm/mmu.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,5 +412,9 @@ extern void *abatron_pteptrs[2];
412412
#include <asm/nohash/mmu.h>
413413
#endif
414414

415+
#if defined(CONFIG_FA_DUMP) || defined(CONFIG_PRESERVE_FA_DUMP)
416+
#define __HAVE_ARCH_RESERVED_KERNEL_PAGES
417+
#endif
418+
415419
#endif /* __KERNEL__ */
416420
#endif /* _ASM_POWERPC_MMU_H_ */

arch/powerpc/include/asm/mmzone.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ u64 memory_hotplug_max(void);
4242
#else
4343
#define memory_hotplug_max() memblock_end_of_DRAM()
4444
#endif /* CONFIG_NUMA */
45-
#ifdef CONFIG_FA_DUMP
46-
#define __HAVE_ARCH_RESERVED_KERNEL_PAGES
47-
#endif
4845

4946
#endif /* __KERNEL__ */
5047
#endif /* _ASM_MMZONE_H_ */

0 commit comments

Comments
 (0)