Merge tag 'libnvdimm-for-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdim...
[linux-2.6-block.git] / arch / powerpc / mm / mem.c
index 1281c6eb3a85b705f09f8f93e4249d84a3716221..fe8c61149fb8230ea71e2231281beaaf79d2031b 100644 (file)
@@ -127,7 +127,8 @@ int __weak remove_section_mapping(unsigned long start, unsigned long end)
        return -ENODEV;
 }
 
-int arch_add_memory(int nid, u64 start, u64 size, bool want_memblock)
+int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
+               bool want_memblock)
 {
        unsigned long start_pfn = start >> PAGE_SHIFT;
        unsigned long nr_pages = size >> PAGE_SHIFT;
@@ -143,15 +144,14 @@ int arch_add_memory(int nid, u64 start, u64 size, bool want_memblock)
                return -EFAULT;
        }
 
-       return __add_pages(nid, start_pfn, nr_pages, want_memblock);
+       return __add_pages(nid, start_pfn, nr_pages, altmap, want_memblock);
 }
 
 #ifdef CONFIG_MEMORY_HOTREMOVE
-int arch_remove_memory(u64 start, u64 size)
+int arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
 {
        unsigned long start_pfn = start >> PAGE_SHIFT;
        unsigned long nr_pages = size >> PAGE_SHIFT;
-       struct vmem_altmap *altmap;
        struct page *page;
        int ret;
 
@@ -160,11 +160,10 @@ int arch_remove_memory(u64 start, u64 size)
         * when querying the zone.
         */
        page = pfn_to_page(start_pfn);
-       altmap = to_vmem_altmap((unsigned long) page);
        if (altmap)
                page += vmem_altmap_offset(altmap);
 
-       ret = __remove_pages(page_zone(page), start_pfn, nr_pages);
+       ret = __remove_pages(page_zone(page), start_pfn, nr_pages, altmap);
        if (ret)
                return ret;