diff mbox series

[2/2] arm64: mm: make use of new memblocks_present() helper

Message ID 20190109202100.6968-3-logang@deltatee.com (mailing list archive)
State New, archived
Headers show
Series Cleanup ARM arches to use common memblocks_present | expand

Commit Message

Logan Gunthorpe Jan. 9, 2019, 8:21 p.m. UTC
Cleanup the arm64_memory_present() function seeing it's very
similar to other arches.

memblocks_present() is a direct replacement of arm64_memory_present()

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/mm/init.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

Comments

Will Deacon Jan. 10, 2019, 2:15 p.m. UTC | #1
On Wed, Jan 09, 2019 at 01:21:00PM -0700, Logan Gunthorpe wrote:
> Cleanup the arm64_memory_present() function seeing it's very
> similar to other arches.
> 
> memblocks_present() is a direct replacement of arm64_memory_present()
> 
> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> ---
>  arch/arm64/mm/init.c | 20 +-------------------
>  1 file changed, 1 insertion(+), 19 deletions(-)

Acked-by: Will Deacon <will.deacon@arm.com>

Did you want us to take this via the arm64 tree?

Will
Logan Gunthorpe Jan. 10, 2019, 4:51 p.m. UTC | #2
On 2019-01-10 7:15 a.m., Will Deacon wrote:
> On Wed, Jan 09, 2019 at 01:21:00PM -0700, Logan Gunthorpe wrote:
>> Cleanup the arm64_memory_present() function seeing it's very
>> similar to other arches.
>>
>> memblocks_present() is a direct replacement of arm64_memory_present()
>>
>> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
>> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
>> Cc: Will Deacon <will.deacon@arm.com>
>> ---
>>  arch/arm64/mm/init.c | 20 +-------------------
>>  1 file changed, 1 insertion(+), 19 deletions(-)
> 
> Acked-by: Will Deacon <will.deacon@arm.com>
> 
> Did you want us to take this via the arm64 tree?

Yes please.

Thanks,

Logan
Catalin Marinas Jan. 21, 2019, 5:34 p.m. UTC | #3
On Thu, Jan 10, 2019 at 09:51:52AM -0700, Logan Gunthorpe wrote:
> On 2019-01-10 7:15 a.m., Will Deacon wrote:
> > On Wed, Jan 09, 2019 at 01:21:00PM -0700, Logan Gunthorpe wrote:
> >> Cleanup the arm64_memory_present() function seeing it's very
> >> similar to other arches.
> >>
> >> memblocks_present() is a direct replacement of arm64_memory_present()
> >>
> >> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
> >> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> >> Cc: Will Deacon <will.deacon@arm.com>
> >> ---
> >>  arch/arm64/mm/init.c | 20 +-------------------
> >>  1 file changed, 1 insertion(+), 19 deletions(-)
> > 
> > Acked-by: Will Deacon <will.deacon@arm.com>
> > 
> > Did you want us to take this via the arm64 tree?
> 
> Yes please.

Patch 2/2 queued for 5.1. Thanks.
diff mbox series

Patch

diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 7205a9085b4d..2302b4093a63 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -285,24 +285,6 @@  int pfn_valid(unsigned long pfn)
 }
 EXPORT_SYMBOL(pfn_valid);
 
-#ifndef CONFIG_SPARSEMEM
-static void __init arm64_memory_present(void)
-{
-}
-#else
-static void __init arm64_memory_present(void)
-{
-	struct memblock_region *reg;
-
-	for_each_memblock(memory, reg) {
-		int nid = memblock_get_region_node(reg);
-
-		memory_present(nid, memblock_region_memory_base_pfn(reg),
-				memblock_region_memory_end_pfn(reg));
-	}
-}
-#endif
-
 static phys_addr_t memory_limit = PHYS_ADDR_MAX;
 
 /*
@@ -489,7 +471,7 @@  void __init bootmem_init(void)
 	 * Sparsemem tries to allocate bootmem in memory_present(), so must be
 	 * done after the fixed reservations.
 	 */
-	arm64_memory_present();
+	memblocks_present();
 
 	sparse_init();
 	zone_sizes_init(min, max);