arm64:mm: initialize max_mapnr using function set_max_mapnr
authorGanapatrao Kulkarni <ganapatrao.kulkarni@caviumnetworks.com>
Tue, 16 Sep 2014 17:53:54 +0000 (18:53 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 17 Sep 2014 17:14:16 +0000 (18:14 +0100)
Initializing max_mapnr using set_max_mapnr() helper function instead
of direct reference. Also not adding PHYS_PFN_OFFSET to max_pfn,
since it already contains it.

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Ganapatrao Kulkarni <ganapatrao.kulkarni@caviumnetworks.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/mm/init.c

index 5472c24018766ea5348d2d0cb56f9a932f46356a..271e654d852ddceff9f3ba3bbc5d7b7fb95b3735 100644 (file)
@@ -256,7 +256,7 @@ static void __init free_unused_memmap(void)
  */
 void __init mem_init(void)
 {
-       max_mapnr   = pfn_to_page(max_pfn + PHYS_PFN_OFFSET) - mem_map;
+       set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
 
 #ifndef CONFIG_SPARSEMEM_VMEMMAP
        free_unused_memmap();