[PATCH 36/36] memblock: remove conditional return with no effect

From: Sang-Heon Jeon

Date: Thu Jul 23 2026 - 15:05:51 EST


Both branches of the check return the same value, so the check has
no effect. Remove it and return the value directly.

This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.

Signed-off-by: Sang-Heon Jeon <ekffu200098@xxxxxxxxx>
---
mm/memblock.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index 036316e9138b..6941fdaa3473 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -2614,15 +2614,10 @@ static int __init prepare_kho_fdt(void)

static int __init reserve_mem_init(void)
{
- int err;
-
if (!kho_is_enabled() || !reserved_mem_count)
return 0;

- err = prepare_kho_fdt();
- if (err)
- return err;
- return err;
+ return prepare_kho_fdt();
}
late_initcall(reserve_mem_init);

--
2.43.0