All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] of/fdt: Clean up early_init_dt_reserve_memory_arch()
@ 2022-07-23  1:53 Peter Collingbourne
  2022-07-25 19:58 ` Rob Herring
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Collingbourne @ 2022-07-23  1:53 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand; +Cc: Peter Collingbourne, devicetree, linux-kernel

As of commit 18250b43f7b6 ("of: fdt: Remove
early_init_dt_reserve_memory_arch() override capability") this is
no longer an arch hook, so rename it to remove the confusing _arch
suffix. Also remove some unnecessary indirection from all but one of
the callers by calling memblock_reserve() directly instead.

Signed-off-by: Peter Collingbourne <pcc@google.com>
Link: https://linux-review.googlesource.com/id/I3362bdd92ae6e47e8f5bac01aa228d32f9d01aad
---
 drivers/of/fdt.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index a8f5b6532165..ac43f1788c1b 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -477,8 +477,8 @@ void *initial_boot_params __ro_after_init;
 
 static u32 of_fdt_crc32;
 
-static int __init early_init_dt_reserve_memory_arch(phys_addr_t base,
-					phys_addr_t size, bool nomap)
+static int __init early_init_dt_reserve_memory(phys_addr_t base,
+					       phys_addr_t size, bool nomap)
 {
 	if (nomap) {
 		/*
@@ -525,7 +525,7 @@ static int __init __reserved_mem_reserve_reg(unsigned long node,
 		size = dt_mem_next_cell(dt_root_size_cells, &prop);
 
 		if (size &&
-		    early_init_dt_reserve_memory_arch(base, size, nomap) == 0) {
+		    early_init_dt_reserve_memory(base, size, nomap) == 0) {
 			pr_debug("Reserved memory: reserved region for node '%s': base %pa, size %lu MiB\n",
 				uname, &base, (unsigned long)(size / SZ_1M));
 			if (!nomap)
@@ -644,7 +644,7 @@ void __init early_init_fdt_scan_reserved_mem(void)
 		fdt_get_mem_rsv(initial_boot_params, n, &base, &size);
 		if (!size)
 			break;
-		early_init_dt_reserve_memory_arch(base, size, false);
+		memblock_reserve(base, size);
 	}
 
 	fdt_scan_reserved_mem();
@@ -661,9 +661,8 @@ void __init early_init_fdt_reserve_self(void)
 		return;
 
 	/* Reserve the dtb region */
-	early_init_dt_reserve_memory_arch(__pa(initial_boot_params),
-					  fdt_totalsize(initial_boot_params),
-					  false);
+	memblock_reserve(__pa(initial_boot_params),
+			 fdt_totalsize(initial_boot_params));
 }
 
 /**
-- 
2.37.1.359.gd136c6c3e2-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] of/fdt: Clean up early_init_dt_reserve_memory_arch()
  2022-07-23  1:53 [PATCH] of/fdt: Clean up early_init_dt_reserve_memory_arch() Peter Collingbourne
@ 2022-07-25 19:58 ` Rob Herring
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2022-07-25 19:58 UTC (permalink / raw)
  To: Peter Collingbourne; +Cc: Frank Rowand, devicetree, linux-kernel, Rob Herring

On Fri, 22 Jul 2022 18:53:31 -0700, Peter Collingbourne wrote:
> As of commit 18250b43f7b6 ("of: fdt: Remove
> early_init_dt_reserve_memory_arch() override capability") this is
> no longer an arch hook, so rename it to remove the confusing _arch
> suffix. Also remove some unnecessary indirection from all but one of
> the callers by calling memblock_reserve() directly instead.
> 
> Signed-off-by: Peter Collingbourne <pcc@google.com>
> Link: https://linux-review.googlesource.com/id/I3362bdd92ae6e47e8f5bac01aa228d32f9d01aad
> ---
>  drivers/of/fdt.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 

Applied, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-25 19:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-23  1:53 [PATCH] of/fdt: Clean up early_init_dt_reserve_memory_arch() Peter Collingbourne
2022-07-25 19:58 ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.