Skip to content

Commit 71d2bce

Browse files
prudo1torvalds
authored andcommitted
kernel/crash_core: suppress unknown crashkernel parameter warning
When booting with crashkernel= on the kernel command line a warning similar to Kernel command line: ro console=ttyS0 crashkernel=256M Unknown kernel command line parameters "crashkernel=256M", will be passed to user space. is printed. This comes from crashkernel= being parsed independent from the kernel parameter handling mechanism. So the code in init/main.c doesn't know that crashkernel= is a valid kernel parameter and prints this incorrect warning. Suppress the warning by adding a dummy early_param handler for crashkernel=. Link: https://lkml.kernel.org/r/[email protected] Fixes: 86d1919 ("init: print out unknown kernel parameters") Signed-off-by: Philipp Rudo <[email protected]> Acked-by: Baoquan He <[email protected]> Cc: Andrew Halaney <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 3386353 commit 71d2bce

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

kernel/crash_core.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <linux/buildid.h>
88
#include <linux/crash_core.h>
9+
#include <linux/init.h>
910
#include <linux/utsname.h>
1011
#include <linux/vmalloc.h>
1112

@@ -295,6 +296,16 @@ int __init parse_crashkernel_low(char *cmdline,
295296
"crashkernel=", suffix_tbl[SUFFIX_LOW]);
296297
}
297298

299+
/*
300+
* Add a dummy early_param handler to mark crashkernel= as a known command line
301+
* parameter and suppress incorrect warnings in init/main.c.
302+
*/
303+
static int __init parse_crashkernel_dummy(char *arg)
304+
{
305+
return 0;
306+
}
307+
early_param("crashkernel", parse_crashkernel_dummy);
308+
298309
Elf_Word *append_elf_note(Elf_Word *buf, char *name, unsigned int type,
299310
void *data, size_t data_len)
300311
{

0 commit comments

Comments
 (0)