[PATCH v2 2/5] sh: remove unreachable memblock_reserve() return value check
Sang-Heon Jeon <[email protected]> Tue, 7 Jul 2026 01:37:50 +0900
| Newsgroups | gmane.linux.kernel,gmane.linux.kernel.mm,gmane.linux.ports.sh.devel |
|---|---|
| Message-ID | <[email protected]> |
reserve_crashkernel() runs from early_reserve_mem() in paging_init(), before the same function calls memblock_allow_resize(). At that point memblock_reserve() either succeeds or panics, never returning an error. Therefore the return value check is unreachable, so remove it and the related logic. No functional change. Signed-off-by: Sang-Heon Jeon <[email protected]> --- arch/sh/kernel/machine_kexec.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c index 37073ca1e0ad..ba9c412f14d9 100644 --- a/arch/sh/kernel/machine_kexec.c +++ b/arch/sh/kernel/machine_kexec.c @@ -165,12 +165,7 @@ void __init reserve_crashkernel(void) goto disable; } } else { - ret = memblock_reserve(crashk_res.start, crash_size); - if (unlikely(ret < 0)) { - pr_err("crashkernel reservation failed - " - "memory is in use\n"); - goto disable; - } + memblock_reserve(crashk_res.start, crash_size); } crashk_res.end = crashk_res.start + crash_size - 1; -- 2.43.0