Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

panic: add note that 'panic_print' parameter is deprecated

Just like for 'panic_print's systcl interface, add similar note for setup
of kernel cmdline parameter and parameter under /sys/module/kernel/.

Also add __core_param_cb() macro, which enables to add special get/set
operation for a kernel parameter.

Link: https://lkml.kernel.org/r/20250825025701.81921-4-feng.tang@linux.alibaba.com
Signed-off-by: Feng Tang <feng.tang@linux.alibaba.com>
Suggested-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Cc: Askar Safin <safinaskar@zohomail.com>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: "Paul E . McKenney" <paulmck@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Feng Tang and committed by
Andrew Morton
2683df65 8c2b91fb

+31 -1
+13
include/linux/moduleparam.h
··· 349 349 __module_param_call("", name, &param_ops_##type, &var, perm, \ 350 350 -1, KERNEL_PARAM_FL_UNSAFE) 351 351 352 + /** 353 + * __core_param_cb - similar like core_param, with a set/get ops instead of type. 354 + * @name: the name of the cmdline and sysfs parameter (often the same as var) 355 + * @var: the variable 356 + * @ops: the set & get operations for this parameter. 357 + * @perm: visibility in sysfs 358 + * 359 + * Ideally this should be called 'core_param_cb', but the name has been 360 + * used for module core parameter, so add the '__' prefix 361 + */ 362 + #define __core_param_cb(name, ops, arg, perm) \ 363 + __module_param_call("", name, ops, arg, perm, -1, 0) 364 + 352 365 #endif /* !MODULE */ 353 366 354 367 /**
+18 -1
kernel/panic.c
··· 937 937 #endif 938 938 939 939 core_param(panic, panic_timeout, int, 0644); 940 - core_param(panic_print, panic_print, ulong, 0644); 941 940 core_param(pause_on_oops, pause_on_oops, int, 0644); 942 941 core_param(panic_on_warn, panic_on_warn, int, 0644); 943 942 core_param(crash_kexec_post_notifiers, crash_kexec_post_notifiers, bool, 0644); 944 943 core_param(panic_console_replay, panic_console_replay, bool, 0644); 944 + 945 + static int panic_print_set(const char *val, const struct kernel_param *kp) 946 + { 947 + pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n"); 948 + return param_set_ulong(val, kp); 949 + } 950 + 951 + static int panic_print_get(char *val, const struct kernel_param *kp) 952 + { 953 + pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n"); 954 + return param_get_ulong(val, kp); 955 + } 956 + 957 + static const struct kernel_param_ops panic_print_ops = { 958 + .set = panic_print_set, 959 + .get = panic_print_get, 960 + }; 961 + __core_param_cb(panic_print, &panic_print_ops, &panic_print, 0644); 945 962 946 963 static int __init oops_setup(char *s) 947 964 {