Thread (5 messages) 5 messages, 2 authors, 13d ago
COOLING13d REVIEWED: 1 (0M)
Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH v2 3/5] powerpc/fadump: remove unreachable memblock_reserve() return value checks

From: Sang-Heon Jeon <hidden>
Date: 2026-07-06 16:39:03
Also in: linux-mm, lkml
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Michael Ellerman, Linus Torvalds

fadump_append_bootargs() and fadump_reserve_mem() both run from
early_init_devtree(), before it calls memblock_allow_resize(). At that
point memblock_reserve() either succeeds or panics, never returning an
error.

Therefore the return value checks are unreachable, so remove them and the
related logic.

No functional change.

Signed-off-by: Sang-Heon Jeon <redacted>
Reviewed-by: Mukesh Kumar Chaurasiya (IBM) <redacted>
---
 arch/powerpc/kernel/fadump.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 7f79c9aea4a9..1629a82b9528 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -154,13 +154,8 @@ void __init fadump_append_bootargs(void)
 	if (!fw_dump.dump_active || !fw_dump.param_area_supported || !fw_dump.param_area)
 		return;
 
-	if (fw_dump.param_area < fw_dump.boot_mem_top) {
-		if (memblock_reserve(fw_dump.param_area, COMMAND_LINE_SIZE)) {
-			pr_warn("WARNING: Can't use additional parameters area!\n");
-			fw_dump.param_area = 0;
-			return;
-		}
-	}
+	if (fw_dump.param_area < fw_dump.boot_mem_top)
+		memblock_reserve(fw_dump.param_area, COMMAND_LINE_SIZE);
 
 	append_args = (char *)fw_dump.param_area;
 	len = strlen(boot_command_line);
@@ -632,10 +627,7 @@ int __init fadump_reserve_mem(void)
 		    (fw_dump.ops->fadump_setup_metadata(&fw_dump) < 0))
 			goto error_out;
 
-		if (memblock_reserve(base, size)) {
-			pr_err("Failed to reserve memory!\n");
-			goto error_out;
-		}
+		memblock_reserve(base, size);
 
 		pr_info("Reserved %lldMB of memory at %#016llx (System RAM: %lldMB)\n",
 			(size >> 20), base, (memblock_phys_mem_size() >> 20));
-- 
2.43.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help