diff options
author | Jisheng Zhang <[email protected]> | 2022-03-23 16:06:36 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2022-03-23 19:00:34 -0700 |
commit | d414cb379ac35e3523484e1d866b27832c2218c7 (patch) | |
tree | 5920c24ec8e1232285d9bdea9e6dbbb6aa225de2 | |
parent | f05fa10901aa4b11a84257ecb7ac7f8fe7c4ee1b (diff) |
riscv: mm: init: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef
Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE" by a
check for "IS_ENABLED(CONFIG_KEXEC_CORE)", to simplify the code and
increase compile coverage.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Jisheng Zhang <[email protected]>
Acked-by: Palmer Dabbelt <[email protected]>
Acked-by: Baoquan He <[email protected]>
Cc: Albert Ou <[email protected]>
Cc: Alexandre Ghiti <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Eric W. Biederman <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Russell King <[email protected]>
Cc: Russell King (Oracle) <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Will Deacon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | arch/riscv/mm/init.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 0d588032d6e6..f6275b317129 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -957,7 +957,6 @@ static inline void setup_vm_final(void) } #endif /* CONFIG_MMU */ -#ifdef CONFIG_KEXEC_CORE /* * reserve_crashkernel() - reserves memory for crash kernel * @@ -974,6 +973,8 @@ static void __init reserve_crashkernel(void) int ret = 0; + if (!IS_ENABLED(CONFIG_KEXEC_CORE)) + return; /* * Don't reserve a region for a crash kernel on a crash kernel * since it doesn't make much sense and we have limited memory @@ -1023,7 +1024,6 @@ static void __init reserve_crashkernel(void) crashk_res.start = crash_base; crashk_res.end = crash_base + crash_size - 1; } -#endif /* CONFIG_KEXEC_CORE */ void __init paging_init(void) { @@ -1037,9 +1037,7 @@ void __init misc_mem_init(void) arch_numa_init(); sparse_init(); zone_sizes_init(); -#ifdef CONFIG_KEXEC_CORE reserve_crashkernel(); -#endif memblock_dump_all(); } |