@@ -1016,8 +1016,8 @@ static void __init reserve_crashkernel(void)
int ret;
total_mem = get_total_mem();
- ret = parse_crashkernel(boot_command_line, total_mem,
- &crash_size, &crash_base);
+ ret = parse_crashkernel_common(boot_command_line, total_mem,
+ &crash_size, &crash_base);
/* invalid value specified or crashkernel=0 */
if (ret || !crash_size)
return;
@@ -114,8 +114,8 @@ static void __init reserve_crashkernel(void)
return;
/* crashkernel=X[@offset] */
- ret = parse_crashkernel(cmdline, memblock_phys_mem_size(),
- &crash_size, &crash_base);
+ ret = parse_crashkernel_common(cmdline, memblock_phys_mem_size(),
+ &crash_size, &crash_base);
if (ret == -ENOENT) {
ret = parse_crashkernel_high(cmdline, 0, &crash_size, &crash_base);
if (ret || !crash_size)
@@ -276,8 +276,8 @@ static void __init setup_crashkernel(unsigned long total, int *n)
unsigned long long base = 0, size = 0;
int ret;
- ret = parse_crashkernel(boot_command_line, total,
- &size, &base);
+ ret = parse_crashkernel_common(boot_command_line, total,
+ &size, &base);
if (ret == 0 && size > 0) {
if (!base) {
sort_regions(rsvd_region, *n);
@@ -267,7 +267,8 @@ static void __init arch_parse_crashkernel(void)
unsigned long long crash_base, crash_size;
total_mem = memblock_phys_mem_size();
- ret = parse_crashkernel(boot_command_line, total_mem, &crash_size, &crash_base);
+ ret = parse_crashkernel_common(boot_command_line, total_mem,
+ &crash_size, &crash_base);
if (ret < 0 || crash_size <= 0)
return;
@@ -885,7 +885,7 @@ void __init prom_init(void)
strcat(arcs_cmdline, arg);
/*
* To do: switch parsing to new style, something like:
- * parse_crashkernel(arg, sysinfo->system_dram_size,
+ * parse_crashkernel_common(arg, sysinfo->system_dram_size,
* &crashk_size, &crashk_base);
*/
#endif
@@ -457,8 +457,8 @@ static void __init mips_parse_crashkernel(void)
int ret;
total_mem = memblock_phys_mem_size();
- ret = parse_crashkernel(boot_command_line, total_mem,
- &crash_size, &crash_base);
+ ret = parse_crashkernel_common(boot_command_line, total_mem,
+ &crash_size, &crash_base);
if (ret != 0 || crash_size <= 0)
return;
@@ -312,8 +312,9 @@ static __init u64 fadump_calculate_reserve_size(void)
* option. If yes, then use that but ignore base as fadump reserves
* memory at a predefined offset.
*/
- ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
- &size, &base);
+ ret = parse_crashkernel_common(boot_command_line,
+ memblock_phys_mem_size(),
+ &size, &base);
if (ret == 0 && size > 0) {
unsigned long max_size;
@@ -108,8 +108,8 @@ void __init reserve_crashkernel(void)
total_mem_sz = memory_limit ? memory_limit : memblock_phys_mem_size();
/* use common parsing */
- ret = parse_crashkernel(boot_command_line, total_mem_sz,
- &crash_size, &crash_base);
+ ret = parse_crashkernel_common(boot_command_line, total_mem_sz,
+ &crash_size, &crash_base);
if (ret == 0 && crash_size > 0) {
crashk_res.start = crash_base;
crashk_res.end = crash_base + crash_size - 1;
@@ -177,8 +177,8 @@ static void __init get_crash_kernel(void *fdt, unsigned long size)
unsigned long long crash_size, crash_base;
int ret;
- ret = parse_crashkernel(boot_command_line, size, &crash_size,
- &crash_base);
+ ret = parse_crashkernel_common(boot_command_line, size,
+ &crash_size, &crash_base);
if (ret != 0 || crash_size == 0)
return;
if (crash_base == 0)
@@ -1326,8 +1326,9 @@ static void __init reserve_crashkernel(void)
return;
}
- ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
- &crash_size, &crash_base);
+ ret = parse_crashkernel_common(boot_command_line,
+ memblock_phys_mem_size(),
+ &crash_size, &crash_base);
if (ret || !crash_size)
return;
@@ -625,8 +625,8 @@ static void __init reserve_crashkernel(void)
phys_addr_t low, high;
int rc;
- rc = parse_crashkernel(boot_command_line, ident_map_size, &crash_size,
- &crash_base);
+ rc = parse_crashkernel_common(boot_command_line, ident_map_size,
+ &crash_size, &crash_base);
crash_base = ALIGN(crash_base, KEXEC_CRASH_MEM_ALIGN);
crash_size = ALIGN(crash_size, KEXEC_CRASH_MEM_ALIGN);
@@ -153,8 +153,9 @@ void __init reserve_crashkernel(void)
unsigned long long crash_size, crash_base;
int ret;
- ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
- &crash_size, &crash_base);
+ ret = parse_crashkernel_common(boot_command_line,
+ memblock_phys_mem_size(),
+ &crash_size, &crash_base);
if (ret == 0 && crash_size > 0) {
crashk_res.start = crash_base;
crashk_res.end = crash_base + crash_size - 1;
@@ -558,7 +558,8 @@ static void __init reserve_crashkernel(void)
total_mem = memblock_phys_mem_size();
/* crashkernel=XM */
- ret = parse_crashkernel(boot_command_line, total_mem, &crash_size, &crash_base);
+ ret = parse_crashkernel_common(boot_command_line, total_mem,
+ &crash_size, &crash_base);
if (ret != 0 || crash_size <= 0) {
/* crashkernel=X,high */
ret = parse_crashkernel_high(boot_command_line, total_mem,
@@ -77,7 +77,7 @@ Elf_Word *append_elf_note(Elf_Word *buf, char *name, unsigned int type,
void *data, size_t data_len);
void final_note(Elf_Word *buf);
-int __init parse_crashkernel(char *cmdline, unsigned long long system_ram,
+int __init parse_crashkernel_common(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);
@@ -273,17 +273,13 @@ static int __init __parse_crashkernel(char *cmdline,
return parse_crashkernel_simple(ck_cmdline, crash_size, crash_base);
}
-/*
- * That function is the entry point for command line parsing and should be
- * called from the arch-specific code.
- */
-int __init parse_crashkernel(char *cmdline,
- unsigned long long system_ram,
- unsigned long long *crash_size,
- unsigned long long *crash_base)
+int __init parse_crashkernel_common(char *cmdline,
+ unsigned long long system_ram,
+ unsigned long long *crash_size,
+ unsigned long long *crash_base)
{
return __parse_crashkernel(cmdline, system_ram, crash_size, crash_base,
- "crashkernel=", NULL);
+ "crashkernel=", NULL);
}
int __init parse_crashkernel_high(char *cmdline,
Now there are parse_crashkernel_high() and parse_crashkernel_low() parsing crashkernel=,high|low. Function parse_crashkernel() could be misunderstood as a generic interface parsing all possible crashkernel kernel parameters. Hence, rename parse_crashkernel() to parse_crashkernel_common() to differentiate it from parse_crashkernel_high() and parse_crashkernel_low(), to remove possible ambiguity. Signed-off-by: Baoquan He <bhe@redhat.com> --- arch/arm/kernel/setup.c | 4 ++-- arch/arm64/mm/init.c | 4 ++-- arch/ia64/kernel/setup.c | 4 ++-- arch/loongarch/kernel/setup.c | 3 ++- arch/mips/cavium-octeon/setup.c | 2 +- arch/mips/kernel/setup.c | 4 ++-- arch/powerpc/kernel/fadump.c | 5 +++-- arch/powerpc/kexec/core.c | 4 ++-- arch/powerpc/mm/nohash/kaslr_booke.c | 4 ++-- arch/riscv/mm/init.c | 5 +++-- arch/s390/kernel/setup.c | 4 ++-- arch/sh/kernel/machine_kexec.c | 5 +++-- arch/x86/kernel/setup.c | 3 ++- include/linux/crash_core.h | 2 +- kernel/crash_core.c | 14 +++++--------- 15 files changed, 34 insertions(+), 33 deletions(-)