[PATCH] panic: Clean up message about deprecated 'panic_print' parameter

Petr Mladek posted 1 patch 1 month, 2 weeks ago
There is a newer version of this series
kernel/panic.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
[PATCH] panic: Clean up message about deprecated 'panic_print' parameter
Posted by Petr Mladek 1 month, 2 weeks ago
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
Re: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
Posted by kernel test robot 1 month, 2 weeks ago
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
Re: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
Posted by Lance Yang 1 month, 2 weeks ago

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	
>
Re: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
Posted by Lance Yang 1 month, 2 weeks ago

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
>>
> 

Re: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
Posted by Lance Yang 1 month, 2 weeks ago

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

Re: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
Posted by Petr Mladek 1 month, 2 weeks ago
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
Re: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
Posted by Lance Yang 1 month, 2 weeks ago

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
[PATCH v2] panic: Clean up message about deprecated 'panic_print' parameter
Posted by Petr Mladek 1 month, 2 weeks ago
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
Re: [PATCH v2] panic: Clean up message about deprecated 'panic_print' parameter
Posted by Feng Tang 1 month, 1 week ago
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
Re: [PATCH v2] panic: Clean up message about deprecated 'panic_print' parameter
Posted by Lance Yang 1 month, 2 weeks ago

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>
Re: [PATCH] panic: Clean up message about deprecated 'panic_print' parameter
Posted by Lance Yang 1 month, 2 weeks ago

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);
>   }
>