[cocci] [PATCH 36/36] memblock: remove conditional return with no effect
Sang-Heon Jeon <[email protected]> Fri, 24 Jul 2026 03:45:38 +0900
| Newsgroups | fr.inria.cocci,org.kernel.vger.linux-kernel,org.kvack.linux-mm |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> --- 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