aboutsummaryrefslogtreecommitdiffstats
path: root/mm/sparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/sparse.c')
-rw-r--r--mm/sparse.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/mm/sparse.c b/mm/sparse.c
index a2183cb5d524..f6a43c09c322 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -237,7 +237,7 @@ static unsigned long *__kmalloc_section_usemap(void)
237} 237}
238#endif /* CONFIG_MEMORY_HOTPLUG */ 238#endif /* CONFIG_MEMORY_HOTPLUG */
239 239
240static unsigned long *sparse_early_usemap_alloc(unsigned long pnum) 240static unsigned long *__init sparse_early_usemap_alloc(unsigned long pnum)
241{ 241{
242 unsigned long *usemap; 242 unsigned long *usemap;
243 struct mem_section *ms = __nr_to_section(pnum); 243 struct mem_section *ms = __nr_to_section(pnum);
@@ -353,17 +353,9 @@ static inline struct page *kmalloc_section_memmap(unsigned long pnum, int nid,
353 return __kmalloc_section_memmap(nr_pages); 353 return __kmalloc_section_memmap(nr_pages);
354} 354}
355 355
356static int vaddr_in_vmalloc_area(void *addr)
357{
358 if (addr >= (void *)VMALLOC_START &&
359 addr < (void *)VMALLOC_END)
360 return 1;
361 return 0;
362}
363
364static void __kfree_section_memmap(struct page *memmap, unsigned long nr_pages) 356static void __kfree_section_memmap(struct page *memmap, unsigned long nr_pages)
365{ 357{
366 if (vaddr_in_vmalloc_area(memmap)) 358 if (is_vmalloc_addr(memmap))
367 vfree(memmap); 359 vfree(memmap);
368 else 360 else
369 free_pages((unsigned long)memmap, 361 free_pages((unsigned long)memmap,