mm/sparse: remove unused parameters in sparse_remove_section()
[linux-2.6-block.git] / mm / sparse.c
index c2afdb26039e58a9edc6a323304a7f5bb513d26f..7a29e10193fe6b20976d725ae2424eda581140a8 100644 (file)
@@ -922,10 +922,14 @@ int __meminit sparse_add_section(int nid, unsigned long start_pfn,
        return 0;
 }
 
-void sparse_remove_section(struct mem_section *ms, unsigned long pfn,
-               unsigned long nr_pages, unsigned long map_offset,
-               struct vmem_altmap *altmap)
+void sparse_remove_section(unsigned long pfn, unsigned long nr_pages,
+                          struct vmem_altmap *altmap)
 {
+       struct mem_section *ms = __pfn_to_section(pfn);
+
+       if (WARN_ON_ONCE(!valid_section(ms)))
+               return;
+
        section_deactivate(pfn, nr_pages, altmap);
 }
 #endif /* CONFIG_MEMORY_HOTPLUG */