aboutsummaryrefslogtreecommitdiffstats
path: root/mm/sparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/sparse.c')
-rw-r--r--mm/sparse.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/sparse.c b/mm/sparse.c
index 2609aba121e8..6b8b5e91ceef 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -264,7 +264,11 @@ unsigned long __init node_memmap_size_bytes(int nid, unsigned long start_pfn,
264 */ 264 */
265static unsigned long sparse_encode_mem_map(struct page *mem_map, unsigned long pnum) 265static unsigned long sparse_encode_mem_map(struct page *mem_map, unsigned long pnum)
266{ 266{
267 return (unsigned long)(mem_map - (section_nr_to_pfn(pnum))); 267 unsigned long coded_mem_map =
268 (unsigned long)(mem_map - (section_nr_to_pfn(pnum)));
269 BUILD_BUG_ON(SECTION_MAP_LAST_BIT > (1UL<<PFN_SECTION_SHIFT));
270 BUG_ON(coded_mem_map & ~SECTION_MAP_MASK);
271 return coded_mem_map;
268} 272}
269 273
270/* 274/*