aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mmzone.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mmzone.h')
-rw-r--r--include/linux/mmzone.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index c9c4a81b9767..a507f43ad221 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -1151,13 +1151,17 @@ struct mem_section {
1151#define SECTION_ROOT_MASK (SECTIONS_PER_ROOT - 1) 1151#define SECTION_ROOT_MASK (SECTIONS_PER_ROOT - 1)
1152 1152
1153#ifdef CONFIG_SPARSEMEM_EXTREME 1153#ifdef CONFIG_SPARSEMEM_EXTREME
1154extern struct mem_section *mem_section[NR_SECTION_ROOTS]; 1154extern struct mem_section **mem_section;
1155#else 1155#else
1156extern struct mem_section mem_section[NR_SECTION_ROOTS][SECTIONS_PER_ROOT]; 1156extern struct mem_section mem_section[NR_SECTION_ROOTS][SECTIONS_PER_ROOT];
1157#endif 1157#endif
1158 1158
1159static inline struct mem_section *__nr_to_section(unsigned long nr) 1159static inline struct mem_section *__nr_to_section(unsigned long nr)
1160{ 1160{
1161#ifdef CONFIG_SPARSEMEM_EXTREME
1162 if (!mem_section)
1163 return NULL;
1164#endif
1161 if (!mem_section[SECTION_NR_TO_ROOT(nr)]) 1165 if (!mem_section[SECTION_NR_TO_ROOT(nr)])
1162 return NULL; 1166 return NULL;
1163 return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK]; 1167 return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK];