powerpc/64s: Fix CONFIG_NUMA=n build due to create_section_mapping()
authorMichael Ellerman <mpe@ellerman.id.au>
Wed, 29 Nov 2023 13:19:19 +0000 (00:19 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 30 Nov 2023 10:31:09 +0000 (21:31 +1100)
With CONFIG_NUMA=n the build fails with:

  arch/powerpc/mm/book3s64/pgtable.c:275:15: error: no previous prototype for ‘create_section_mapping’ [-Werror=missing-prototypes]
  275 | int __meminit create_section_mapping(unsigned long start, unsigned long end,
      |               ^~~~~~~~~~~~~~~~~~~~~~

That happens because the prototype for create_section_mapping() is in
asm/mmzone.h, but asm/mmzone.h is only included by linux/mmzone.h
when CONFIG_NUMA=y.

In fact the prototype is only needed by arch/powerpc/mm code, so move
the prototype into arch/powerpc/mm/mmu_decl.h, which also fixes the
build error.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231129131919.2528517-5-mpe@ellerman.id.au
arch/powerpc/include/asm/mmzone.h
arch/powerpc/mm/mmu_decl.h

index 4c6c6dbd182f451fd809adb7e60441a8babb7c58..4740ca230d36ac80abb17719cf813fb30e35dd37 100644 (file)
@@ -46,10 +46,5 @@ u64 memory_hotplug_max(void);
 #define __HAVE_ARCH_RESERVED_KERNEL_PAGES
 #endif
 
-#ifdef CONFIG_MEMORY_HOTPLUG
-extern int create_section_mapping(unsigned long start, unsigned long end,
-                                 int nid, pgprot_t prot);
-#endif
-
 #endif /* __KERNEL__ */
 #endif /* _ASM_MMZONE_H_ */
index 7f9ff0640124af711e6e662e5dfac1315386ead0..72341b9fb5521ff6032d6b3998bb972714e6a1d0 100644 (file)
@@ -181,3 +181,8 @@ static inline bool debug_pagealloc_enabled_or_kfence(void)
 {
        return IS_ENABLED(CONFIG_KFENCE) || debug_pagealloc_enabled();
 }
+
+#ifdef CONFIG_MEMORY_HOTPLUG
+int create_section_mapping(unsigned long start, unsigned long end,
+                          int nid, pgprot_t prot);
+#endif