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.
Suggested-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Feng Tang <feng.tang@linux.alibaba.com>
---
include/linux/moduleparam.h | 14 ++++++++++++++
kernel/panic.c | 19 ++++++++++++++++++-
2 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 3a25122d83e2..381c3779244c 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -199,6 +199,7 @@ struct kparam_array
#define core_param_cb(name, ops, arg, perm) \
__level_param_cb(name, ops, arg, perm, 1)
+
/**
* postcore_param_cb - general callback for a module/cmdline parameter
* to be evaluated before postcore initcall level
@@ -349,6 +350,19 @@ static inline void kernel_param_unlock(struct module *mod)
__module_param_call("", name, ¶m_ops_##type, &var, perm, \
-1, KERNEL_PARAM_FL_UNSAFE)
+/**
+ * __core_param_cb - similar like core_param, with a set/get ops instead of type.
+ * @name: the name of the cmdline and sysfs parameter (often the same as var)
+ * @var: the variable
+ * @ops: the set & get operations for this parameter.
+ * @perm: visibility in sysfs
+ *
+ * Ideally this should be called 'core_param_cb', but the name has been
+ * used for module core parameter, so add the '__' prefix
+ */
+#define __core_param_cb(name, ops, arg, perm) \
+ __module_param_call("", name, ops, arg, perm, -1, 0)
+
#endif /* !MODULE */
/**
diff --git a/kernel/panic.c b/kernel/panic.c
index 72fcbb5a071b..12a10e17ab4a 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -937,12 +937,29 @@ EXPORT_SYMBOL(__stack_chk_fail);
#endif
core_param(panic, panic_timeout, int, 0644);
-core_param(panic_print, panic_print, ulong, 0644);
core_param(pause_on_oops, pause_on_oops, int, 0644);
core_param(panic_on_warn, panic_on_warn, int, 0644);
core_param(crash_kexec_post_notifiers, crash_kexec_post_notifiers, bool, 0644);
core_param(panic_console_replay, panic_console_replay, bool, 0644);
+static int panic_print_set(const char *val, const struct kernel_param *kp)
+{
+ pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
+ return param_set_ulong(val, kp);
+}
+
+static int panic_print_get(char *val, const struct kernel_param *kp)
+{
+ pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
+ return param_get_ulong(val, kp);
+}
+
+static const struct kernel_param_ops panic_print_ops = {
+ .set = panic_print_set,
+ .get = panic_print_get,
+};
+__core_param_cb(panic_print, &panic_print_ops, &panic_print, 0644);
+
static int __init oops_setup(char *s)
{
if (!s)
--
2.43.5
On Fri 2025-08-15 15:14:28, Feng Tang wrote:
> 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.
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -937,12 +937,29 @@ EXPORT_SYMBOL(__stack_chk_fail);
> #endif
>
> core_param(panic, panic_timeout, int, 0644);
> -core_param(panic_print, panic_print, ulong, 0644);
> core_param(pause_on_oops, pause_on_oops, int, 0644);
> core_param(panic_on_warn, panic_on_warn, int, 0644);
> core_param(crash_kexec_post_notifiers, crash_kexec_post_notifiers, bool, 0644);
> core_param(panic_console_replay, panic_console_replay, bool, 0644);
>
> +static int panic_print_set(const char *val, const struct kernel_param *kp)
> +{
> + pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> + return param_set_ulong(val, kp);
> +}
> +
> +static int panic_print_get(char *val, const struct kernel_param *kp)
> +{
> + pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> + return param_get_ulong(val, kp);
> +}
It should be enough to print the message only once and avoid
duplication in the sources.
Also I would make the message more direct, something like:
pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
I am going to send a followup patch. Feel free to keep this one as is:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
Remove duplication of the message about the deprecated 'panic_print'
parameter.
Also make the wording more direct. Make it clear that the new
parameters already exist and should be used instead.
Signed-off-by: Petr Mladek <pmladek@suse.com>
---
This can be used as a follow up patch.
Or feel free to squash it into the 3rd patch.
kernel/panic.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/kernel/panic.c b/kernel/panic.c
index 12a10e17ab4a..d3907fd95d72 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -122,10 +122,15 @@ static int proc_taint(const struct ctl_table *table, int write,
return err;
}
+static void panic_print_deprecated(void)
+{
+ pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
+}
+
static int sysctl_panic_print_handler(const struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
- pr_info_once("Kernel: 'panic_print' sysctl interface will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
+ panic_print_deprecated();
return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
}
@@ -944,13 +949,13 @@ core_param(panic_console_replay, panic_console_replay, bool, 0644);
static int panic_print_set(const char *val, const struct kernel_param *kp)
{
- pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
+ panic_print_deprecated();
return param_set_ulong(val, kp);
}
static int panic_print_get(char *val, const struct kernel_param *kp)
{
- pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
+ panic_print_deprecated();
return param_get_ulong(val, kp);
}
--
2.50.1
Hi Petr,
kernel test robot noticed the following build errors:
url: https://github.com/intel-lab-lkp/linux/commits/UPDATE-20250819-180717/Feng-Tang/lib-sys_info-handle-sys_info_mask-0-case/20250815-152131
base: the 3th patch of https://lore.kernel.org/r/20250815071428.98041-4-feng.tang%40linux.alibaba.com
patch link: https://lore.kernel.org/r/aKRJKZHgcxyNF3y7%40pathway.suse.cz
patch subject: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
config: i386-buildonly-randconfig-004-20250820 (https://download.01.org/0day-ci/archive/20250820/202508200907.PsZ3geub-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250820/202508200907.PsZ3geub-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508200907.PsZ3geub-lkp@intel.com/
All errors (new ones prefixed by >>):
>> kernel/panic.c:952:2: error: call to undeclared function 'panic_print_deprecated'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
952 | panic_print_deprecated();
| ^
kernel/panic.c:958:2: error: call to undeclared function 'panic_print_deprecated'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
958 | panic_print_deprecated();
| ^
2 errors generated.
vim +/panic_print_deprecated +952 kernel/panic.c
949
950 static int panic_print_set(const char *val, const struct kernel_param *kp)
951 {
> 952 panic_print_deprecated();
953 return param_set_ulong(val, kp);
954 }
955
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
On 2025/8/20 09:31, kernel test robot wrote:
> Hi Petr,
>
> kernel test robot noticed the following build errors:
>
>
>
> url: https://github.com/intel-lab-lkp/linux/commits/UPDATE-20250819-180717/Feng-Tang/lib-sys_info-handle-sys_info_mask-0-case/20250815-152131
> base: the 3th patch of https://lore.kernel.org/r/20250815071428.98041-4-feng.tang%40linux.alibaba.com
> patch link: https://lore.kernel.org/r/aKRJKZHgcxyNF3y7%40pathway.suse.cz
> patch subject: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
> config: i386-buildonly-randconfig-004-20250820 (https://download.01.org/0day-ci/archive/20250820/202508200907.PsZ3geub-lkp@intel.com/config)
> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250820/202508200907.PsZ3geub-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202508200907.PsZ3geub-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
>>> kernel/panic.c:952:2: error: call to undeclared function 'panic_print_deprecated'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
> 952 | panic_print_deprecated();
> | ^
> kernel/panic.c:958:2: error: call to undeclared function 'panic_print_deprecated'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
> 958 | panic_print_deprecated();
> | ^
> 2 errors generated.
Oops, panic_print_deprecated() is defined within the #ifdef
CONFIG_PROC_SYSCTL block, but it's also called from panic_print_set()
and panic_print_get(), which are outside of that block.
So, we need to move the definition out of the block to a common
scope where all its callers can see it. @Petr wdyt?
Thanks,
Lance
>
>
> vim +/panic_print_deprecated +952 kernel/panic.c
>
> 949
> 950 static int panic_print_set(const char *val, const struct kernel_param *kp)
> 951 {
> > 952 panic_print_deprecated();
> 953 return param_set_ulong(val, kp);
> 954 }
> 955
>
On 2025/8/20 09:54, Lance Yang wrote:
>
>
> On 2025/8/20 09:31, kernel test robot wrote:
>> Hi Petr,
>>
>> kernel test robot noticed the following build errors:
>>
>>
>>
>> url: https://github.com/intel-lab-lkp/linux/commits/
>> UPDATE-20250819-180717/Feng-Tang/lib-sys_info-handle-sys_info_mask-0-
>> case/20250815-152131
>> base: the 3th patch of https://lore.kernel.org/
>> r/20250815071428.98041-4-feng.tang%40linux.alibaba.com
>> patch link: https://lore.kernel.org/r/
>> aKRJKZHgcxyNF3y7%40pathway.suse.cz
>> patch subject: [PATCH] panic: Clean up message about deprecated
>> 'panic_print' parameter
>> config: i386-buildonly-randconfig-004-20250820 (https://
>> download.01.org/0day-ci/archive/20250820/202508200907.PsZ3geub-
>> lkp@intel.com/config)
>> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project
>> 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/
>> archive/20250820/202508200907.PsZ3geub-lkp@intel.com/reproduce)
>>
>> If you fix the issue in a separate patch/commit (i.e. not just a new
>> version of
>> the same patch/commit), kindly add following tags
>> | Reported-by: kernel test robot <lkp@intel.com>
>> | Closes: https://lore.kernel.org/oe-kbuild-all/202508200907.PsZ3geub-
>> lkp@intel.com/
>>
>> All errors (new ones prefixed by >>):
>>
>>>> kernel/panic.c:952:2: error: call to undeclared function
>>>> 'panic_print_deprecated'; ISO C99 and later do not support implicit
>>>> function declarations [-Wimplicit-function-declaration]
>> 952 | panic_print_deprecated();
>> | ^
>> kernel/panic.c:958:2: error: call to undeclared function
>> 'panic_print_deprecated'; ISO C99 and later do not support implicit
>> function declarations [-Wimplicit-function-declaration]
>> 958 | panic_print_deprecated();
>> | ^
>> 2 errors generated.
>
>
> Oops, panic_print_deprecated() is defined within the #ifdef
> CONFIG_PROC_SYSCTL block, but it's also called from panic_print_set()
Correction:
CONFIG_SYSCTL block - sorry ;(
> and panic_print_get(), which are outside of that block.
>
> So, we need to move the definition out of the block to a common
> scope where all its callers can see it. @Petr wdyt?
>
> Thanks,
> Lance
>
>>
>>
>> vim +/panic_print_deprecated +952 kernel/panic.c
>>
>> 949
>> 950 static int panic_print_set(const char *val, const struct
>> kernel_param *kp)
>> 951 {
>> > 952 panic_print_deprecated();
>> 953 return param_set_ulong(val, kp);
>> 954 }
>> 955
>>
>
On 2025/8/20 09:56, Lance Yang wrote:
>
>
> On 2025/8/20 09:54, Lance Yang wrote:
>>
>>
>> On 2025/8/20 09:31, kernel test robot wrote:
>>> Hi Petr,
>>>
>>> kernel test robot noticed the following build errors:
>>>
>>>
>>>
>>> url: https://github.com/intel-lab-lkp/linux/commits/
>>> UPDATE-20250819-180717/Feng-Tang/lib-sys_info-handle-sys_info_mask-0-
>>> case/20250815-152131
>>> base: the 3th patch of https://lore.kernel.org/
>>> r/20250815071428.98041-4-feng.tang%40linux.alibaba.com
>>> patch link: https://lore.kernel.org/r/
>>> aKRJKZHgcxyNF3y7%40pathway.suse.cz
>>> patch subject: [PATCH] panic: Clean up message about deprecated
>>> 'panic_print' parameter
>>> config: i386-buildonly-randconfig-004-20250820 (https://
>>> download.01.org/0day-ci/archive/20250820/202508200907.PsZ3geub-
>>> lkp@intel.com/config)
>>> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project
>>> 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
>>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/
>>> archive/20250820/202508200907.PsZ3geub-lkp@intel.com/reproduce)
>>>
>>> If you fix the issue in a separate patch/commit (i.e. not just a new
>>> version of
>>> the same patch/commit), kindly add following tags
>>> | Reported-by: kernel test robot <lkp@intel.com>
>>> | Closes: https://lore.kernel.org/oe-kbuild-
>>> all/202508200907.PsZ3geub- lkp@intel.com/
>>>
>>> All errors (new ones prefixed by >>):
>>>
>>>>> kernel/panic.c:952:2: error: call to undeclared function
>>>>> 'panic_print_deprecated'; ISO C99 and later do not support implicit
>>>>> function declarations [-Wimplicit-function-declaration]
>>> 952 | panic_print_deprecated();
>>> | ^
>>> kernel/panic.c:958:2: error: call to undeclared function
>>> 'panic_print_deprecated'; ISO C99 and later do not support implicit
>>> function declarations [-Wimplicit-function-declaration]
>>> 958 | panic_print_deprecated();
>>> | ^
>>> 2 errors generated.
>>
>>
>> Oops, panic_print_deprecated() is defined within the #ifdef
>> CONFIG_PROC_SYSCTL block, but it's also called from panic_print_set()
>
> Correction:
>
> CONFIG_SYSCTL block - sorry ;(
>
>> and panic_print_get(), which are outside of that block.
>>
>> So, we need to move the definition out of the block to a common
>> scope where all its callers can see it. @Petr wdyt?
>>
If Petr is cool, @Andrew could you squash the following?
---
Subject: [PATCH 1/1] fixup: panic: clean up message about deprecated
'panic_print' parameter
From: Lance Yang <lance.yang@linux.dev>
Moving the definition out of the CONFIG_SYSCTL block to a common scope
where all its callers can see it.
Reported-by: kernel test robot <lkp@intel.com>
Closes:
https://lore.kernel.org/oe-kbuild-all/202508200907.PsZ3geub-lkp@intel.com/
Signed-off-by: Lance Yang <lance.yang@linux.dev>
---
kernel/panic.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/kernel/panic.c b/kernel/panic.c
index d3907fd95d72..24bca263f896 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -77,6 +77,11 @@ ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
EXPORT_SYMBOL(panic_notifier_list);
+static void panic_print_deprecated(void)
+{
+ pr_info_once("Kernel: The 'panic_print' parameter is now deprecated.
Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
+}
+
#ifdef CONFIG_SYSCTL
/*
@@ -122,11 +127,6 @@ static int proc_taint(const struct ctl_table
*table, int write,
return err;
}
-static void panic_print_deprecated(void)
-{
- pr_info_once("Kernel: The 'panic_print' parameter is now deprecated.
Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
-}
-
static int sysctl_panic_print_handler(const struct ctl_table *table,
int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
--
2.49.0
On Wed 2025-08-20 16:57:48, Lance Yang wrote:
> On 2025/8/20 09:56, Lance Yang wrote:
> > On 2025/8/20 09:54, Lance Yang wrote:
> > > On 2025/8/20 09:31, kernel test robot wrote:
> > > > All errors (new ones prefixed by >>):
> > > >
> > > > > > kernel/panic.c:952:2: error: call to undeclared function
> > > > > > 'panic_print_deprecated'; ISO C99 and later do not
> > > > > > support implicit function declarations
> > > > > > [-Wimplicit-function-declaration]
> > > > 952 | panic_print_deprecated();
> > > > | ^
> > > > kernel/panic.c:958:2: error: call to undeclared function
> > > > 'panic_print_deprecated'; ISO C99 and later do not support
> > > > implicit function declarations [-Wimplicit-function-declaration]
> > > > 958 | panic_print_deprecated();
> > > > | ^
> > > > 2 errors generated.
> > >
> > >
> > > Oops, panic_print_deprecated() is defined within the #ifdef
> > > CONFIG_PROC_SYSCTL block, but it's also called from panic_print_set()
> >
>
> If Petr is cool, @Andrew could you squash the following?
>
> ---
> Subject: [PATCH 1/1] fixup: panic: clean up message about deprecated
> 'panic_print' parameter
The patch was malformed probably by your mail client.
Below is the fixed and revied variant.
I am going to resend also the squashed version.
Here is the fixed followup patch:
From 35ded31e9ff2c9925d7a78472115c9929b582c63 Mon Sep 17 00:00:00 2001
From: Lance Yang <lance.yang@linux.dev>
Date: Wed, 20 Aug 2025 11:25:31 +0200
Subject: [PATCH] fixup: panic: clean up message about deprecated 'panic_print'
parameter
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202508200907.PsZ3geub-lkp@intel.com/
Signed-off-by: Lance Yang <lance.yang@linux.dev>
Reviewed-by: Petr Mladek <pmladek@suse.com>
---
kernel/panic.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/kernel/panic.c b/kernel/panic.c
index d3907fd95d72..24bca263f896 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -77,6 +77,11 @@ ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
EXPORT_SYMBOL(panic_notifier_list);
+static void panic_print_deprecated(void)
+{
+ pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
+}
+
#ifdef CONFIG_SYSCTL
/*
@@ -122,11 +127,6 @@ static int proc_taint(const struct ctl_table *table, int write,
return err;
}
-static void panic_print_deprecated(void)
-{
- pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
-}
-
static int sysctl_panic_print_handler(const struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
--
2.50.1
On 2025/8/20 17:33, Petr Mladek wrote: > On Wed 2025-08-20 16:57:48, Lance Yang wrote: >> On 2025/8/20 09:56, Lance Yang wrote: >>> On 2025/8/20 09:54, Lance Yang wrote: >>>> On 2025/8/20 09:31, kernel test robot wrote: >>>>> All errors (new ones prefixed by >>): >>>>> >>>>>>> kernel/panic.c:952:2: error: call to undeclared function >>>>>>> 'panic_print_deprecated'; ISO C99 and later do not >>>>>>> support implicit function declarations >>>>>>> [-Wimplicit-function-declaration] >>>>> 952 | panic_print_deprecated(); >>>>> | ^ >>>>> kernel/panic.c:958:2: error: call to undeclared function >>>>> 'panic_print_deprecated'; ISO C99 and later do not support >>>>> implicit function declarations [-Wimplicit-function-declaration] >>>>> 958 | panic_print_deprecated(); >>>>> | ^ >>>>> 2 errors generated. >>>> >>>> >>>> Oops, panic_print_deprecated() is defined within the #ifdef >>>> CONFIG_PROC_SYSCTL block, but it's also called from panic_print_set() >>> >> >> If Petr is cool, @Andrew could you squash the following? >> >> --- >> Subject: [PATCH 1/1] fixup: panic: clean up message about deprecated >> 'panic_print' parameter > > The patch was malformed probably by your mail client. > Below is the fixed and revied variant. Yes. My client messed up the formatting - git send-email it is ;) Thanks, Lance
Remove duplication of the message about deprecated 'panic_print'
parameter.
Also make the wording more direct. Make it clear that the new
parameters already exist and should be used instead.
Signed-off-by: Petr Mladek <pmladek@suse.com>
---
Changes since v1:
- fixed compilation with CONFIG_SYSCTL disabled (kernel test
robot <lkp@intel.com>)
Thanks Lance Yang <lance.yang@linux.dev> for debugging the compilation
error reported by the test robot.
kernel/panic.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/kernel/panic.c b/kernel/panic.c
index 12a10e17ab4a..24bca263f896 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -77,6 +77,11 @@ ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
EXPORT_SYMBOL(panic_notifier_list);
+static void panic_print_deprecated(void)
+{
+ pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
+}
+
#ifdef CONFIG_SYSCTL
/*
@@ -125,7 +130,7 @@ static int proc_taint(const struct ctl_table *table, int write,
static int sysctl_panic_print_handler(const struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
- pr_info_once("Kernel: 'panic_print' sysctl interface will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
+ panic_print_deprecated();
return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
}
@@ -944,13 +949,13 @@ core_param(panic_console_replay, panic_console_replay, bool, 0644);
static int panic_print_set(const char *val, const struct kernel_param *kp)
{
- pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
+ panic_print_deprecated();
return param_set_ulong(val, kp);
}
static int panic_print_get(char *val, const struct kernel_param *kp)
{
- pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
+ panic_print_deprecated();
return param_get_ulong(val, kp);
}
--
2.50.1
On Wed, Aug 20, 2025 at 11:40:32AM +0200, Petr Mladek wrote:
> Remove duplication of the message about deprecated 'panic_print'
> parameter.
>
> Also make the wording more direct. Make it clear that the new
> parameters already exist and should be used instead.
>
> Signed-off-by: Petr Mladek <pmladek@suse.com>
Thanks for the cleanup!
Reviewed-by: Feng Tang <feng.tang@linux.alibaba.com>
> ---
> Changes since v1:
>
> - fixed compilation with CONFIG_SYSCTL disabled (kernel test
> robot <lkp@intel.com>)
>
> Thanks Lance Yang <lance.yang@linux.dev> for debugging the compilation
> error reported by the test robot.
>
> kernel/panic.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/panic.c b/kernel/panic.c
> index 12a10e17ab4a..24bca263f896 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -77,6 +77,11 @@ ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
>
> EXPORT_SYMBOL(panic_notifier_list);
>
> +static void panic_print_deprecated(void)
> +{
> + pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
> +}
> +
> #ifdef CONFIG_SYSCTL
>
> /*
> @@ -125,7 +130,7 @@ static int proc_taint(const struct ctl_table *table, int write,
> static int sysctl_panic_print_handler(const struct ctl_table *table, int write,
> void *buffer, size_t *lenp, loff_t *ppos)
> {
> - pr_info_once("Kernel: 'panic_print' sysctl interface will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> + panic_print_deprecated();
> return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
> }
>
> @@ -944,13 +949,13 @@ core_param(panic_console_replay, panic_console_replay, bool, 0644);
>
> static int panic_print_set(const char *val, const struct kernel_param *kp)
> {
> - pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> + panic_print_deprecated();
> return param_set_ulong(val, kp);
> }
>
> static int panic_print_get(char *val, const struct kernel_param *kp)
> {
> - pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> + panic_print_deprecated();
> return param_get_ulong(val, kp);
> }
>
> --
> 2.50.1
On 2025/8/20 17:40, Petr Mladek wrote: > Remove duplication of the message about deprecated 'panic_print' > parameter. > > Also make the wording more direct. Make it clear that the new > parameters already exist and should be used instead. > > Signed-off-by: Petr Mladek <pmladek@suse.com> Confirmed that it fixes the build error when CONFIG_SYSCTL is disabled. Tested-by: Lance Yang <lance.yang@linux.dev>
On 2025/8/19 17:51, Petr Mladek wrote:
> Remove duplication of the message about the deprecated 'panic_print'
> parameter.
>
> Also make the wording more direct. Make it clear that the new
> parameters already exist and should be used instead.
>
> Signed-off-by: Petr Mladek <pmladek@suse.com>
Nice cleanup! This makes the code cleaner and the message
more direct. So, feel free to add:
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Thanks,
Lance
> ---
> This can be used as a follow up patch.
> Or feel free to squash it into the 3rd patch.
>
> kernel/panic.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/panic.c b/kernel/panic.c
> index 12a10e17ab4a..d3907fd95d72 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -122,10 +122,15 @@ static int proc_taint(const struct ctl_table *table, int write,
> return err;
> }
>
> +static void panic_print_deprecated(void)
> +{
> + pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");
> +}
> +
> static int sysctl_panic_print_handler(const struct ctl_table *table, int write,
> void *buffer, size_t *lenp, loff_t *ppos)
> {
> - pr_info_once("Kernel: 'panic_print' sysctl interface will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> + panic_print_deprecated();
> return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
> }
>
> @@ -944,13 +949,13 @@ core_param(panic_console_replay, panic_console_replay, bool, 0644);
>
> static int panic_print_set(const char *val, const struct kernel_param *kp)
> {
> - pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> + panic_print_deprecated();
> return param_set_ulong(val, kp);
> }
>
> static int panic_print_get(char *val, const struct kernel_param *kp)
> {
> - pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> + panic_print_deprecated();
> return param_get_ulong(val, kp);
> }
>
© 2016 - 2026 Red Hat, Inc.