[PATCH v18 11/17] kdump: Make parse_crashkernel_{high|low} static

Zhen Lei thunder.leizhen at huawei.com
Wed Dec 22 05:08:14 PST 2021


Currently, parse_crashkernel_{high|low} is only referenced by
parse_crashkernel_in_order(), and they are in the same file. So make it
static, and move it into "#ifdef CONFIG_ARCH_WANT_RESERVE_CRASH_KERNEL".

Signed-off-by: Zhen Lei <thunder.leizhen at huawei.com>
---
 include/linux/crash_core.h |  4 ----
 kernel/crash_core.c        | 19 ++++++++++---------
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/include/linux/crash_core.h b/include/linux/crash_core.h
index de62a722431e7db..529a0a783190bfe 100644
--- a/include/linux/crash_core.h
+++ b/include/linux/crash_core.h
@@ -79,9 +79,5 @@ void final_note(Elf_Word *buf);
 
 int __init parse_crashkernel(char *cmdline, unsigned long long system_ram,
 		unsigned long long *crash_size, unsigned long long *crash_base);
-int parse_crashkernel_high(char *cmdline, unsigned long long system_ram,
-		unsigned long long *crash_size, unsigned long long *crash_base);
-int parse_crashkernel_low(char *cmdline, unsigned long long system_ram,
-		unsigned long long *crash_size, unsigned long long *crash_base);
 
 #endif /* LINUX_CRASH_CORE_H */
diff --git a/kernel/crash_core.c b/kernel/crash_core.c
index 496dae2718cf026..a037076b89a9bb2 100644
--- a/kernel/crash_core.c
+++ b/kernel/crash_core.c
@@ -279,7 +279,15 @@ int __init parse_crashkernel(char *cmdline,
 	return __parse_crashkernel(cmdline, system_ram, crash_size, crash_base, SUFFIX_NULL);
 }
 
-int __init parse_crashkernel_high(char *cmdline,
+
+/*
+ * --------- Crashkernel reservation ------------------------------
+ */
+
+#ifdef CONFIG_ARCH_WANT_RESERVE_CRASH_KERNEL
+
+#ifdef CONFIG_64BIT
+static int __init parse_crashkernel_high(char *cmdline,
 			     unsigned long long system_ram,
 			     unsigned long long *crash_size,
 			     unsigned long long *crash_base)
@@ -287,7 +295,7 @@ int __init parse_crashkernel_high(char *cmdline,
 	return __parse_crashkernel(cmdline, system_ram, crash_size, crash_base, SUFFIX_HIGH);
 }
 
-int __init parse_crashkernel_low(char *cmdline,
+static int __init parse_crashkernel_low(char *cmdline,
 			     unsigned long long system_ram,
 			     unsigned long long *crash_size,
 			     unsigned long long *crash_base)
@@ -295,13 +303,6 @@ int __init parse_crashkernel_low(char *cmdline,
 	return __parse_crashkernel(cmdline, system_ram, crash_size, crash_base, SUFFIX_LOW);
 }
 
-/*
- * --------- Crashkernel reservation ------------------------------
- */
-
-#ifdef CONFIG_ARCH_WANT_RESERVE_CRASH_KERNEL
-
-#ifdef CONFIG_64BIT
 static int __init reserve_crashkernel_low(unsigned long long low_size)
 {
 	unsigned long long low_base = 0;
-- 
2.25.1




More information about the linux-arm-kernel mailing list