Skip to content

Commit db7f37d

Browse files
tbreedspaulusmack
authored andcommitted
powerpc: Fix building of arch/powerpc/mm/mem.o when MEMORY_HOTPLUG=y and SPARSEMEM=n
Currently the kernel fails to build with the above config options with: CC arch/powerpc/mm/mem.o arch/powerpc/mm/mem.c: In function 'arch_add_memory': arch/powerpc/mm/mem.c:130: error: implicit declaration of function 'create_section_mapping' This explicitly includes asm/sparsemem.h in arch/powerpc/mm/mem.c and moves the guards in include/asm-powerpc/sparsemem.h to protect the SPARSEMEM specific portions only. Signed-off-by: Tony Breeds <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent f3e909c commit db7f37d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

arch/powerpc/mm/mem.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <asm/btext.h>
4545
#include <asm/tlb.h>
4646
#include <asm/sections.h>
47+
#include <asm/sparsemem.h>
4748
#include <asm/vdso.h>
4849
#include <asm/fixmap.h>
4950

include/asm-powerpc/sparsemem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#define MAX_PHYSADDR_BITS 44
1414
#define MAX_PHYSMEM_BITS 44
1515

16+
#endif /* CONFIG_SPARSEMEM */
17+
1618
#ifdef CONFIG_MEMORY_HOTPLUG
1719
extern void create_section_mapping(unsigned long start, unsigned long end);
1820
extern int remove_section_mapping(unsigned long start, unsigned long end);
@@ -26,7 +28,5 @@ static inline int hot_add_scn_to_nid(unsigned long scn_addr)
2628
#endif /* CONFIG_NUMA */
2729
#endif /* CONFIG_MEMORY_HOTPLUG */
2830

29-
#endif /* CONFIG_SPARSEMEM */
30-
3131
#endif /* __KERNEL__ */
3232
#endif /* _ASM_POWERPC_SPARSEMEM_H */

0 commit comments

Comments
 (0)