diff mbox series

[v4,09/10] arm64: kdump: Use IS_ENABLED(CONFIG_CRASH_DUMP) instead of #ifdef

Message ID 767e34a7ec29c417fdd5ff6e0fc76bc93d4f3c6f.1626266516.git.geert+renesas@glider.be (mailing list archive)
State New
Headers show
Series Add generic support for kdump DT properties | expand

Commit Message

Geert Uytterhoeven July 14, 2021, 12:50 p.m. UTC
Replace the conditional compilation using "#ifdef CONFIG_CRASH_DUMP" by
a check for "IS_ENABLED(CONFIG_CRASH_DUMP)", to increase compile
coverage and to simplify the code.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v4:
  - New.
---
 arch/arm64/mm/init.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index f90ba99437c0f3c9..dc2a5b73232843e4 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -124,7 +124,6 @@  static void __init reserve_crashkernel(void)
 }
 #endif /* CONFIG_KEXEC_CORE */
 
-#ifdef CONFIG_CRASH_DUMP
 /*
  * reserve_elfcorehdr() - reserves memory for elf core header
  *
@@ -135,7 +134,7 @@  static void __init reserve_crashkernel(void)
  */
 static void __init reserve_elfcorehdr(void)
 {
-	if (!elfcorehdr_size)
+	if (!IS_ENABLED(CONFIG_CRASH_DUMP) || !elfcorehdr_size)
 		return;
 
 	if (memblock_is_region_reserved(elfcorehdr_addr, elfcorehdr_size)) {
@@ -148,11 +147,6 @@  static void __init reserve_elfcorehdr(void)
 	pr_info("Reserving %lldKB of memory at 0x%llx for elfcorehdr\n",
 		elfcorehdr_size >> 10, elfcorehdr_addr);
 }
-#else
-static void __init reserve_elfcorehdr(void)
-{
-}
-#endif /* CONFIG_CRASH_DUMP */
 
 /*
  * Return the maximum physical address for a zone accessible by the given bits