Skip to contentSkip to conversation

panic: remove the unneeded panic_print_get()

PATCH Applied Feng Tang 3 participants 3 messages Sep 2 – Sep 3

lore
Share & tools
lore

Feng Tang

author
#0 lore raw

PATCH 1/1 panic: remove the unneeded panic_print_get()

panic_print_get() was introduced in commit 2683df6539cb ("panic: add note that 'panic_print' parameter is deprecated") to print out warning message of the deprecation of 'panic_print' on read access.

Since commit 90f3c123247e ("panic: only warn about deprecated panic_print on write access"), panic_print_get() wrapper is not needed anymore for read access, so remove it and use param_get_ulong() instead.

---
 kernel/panic.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
kernel/panic.c +1 -6
index 7dda841c16f9..50715f14cf04 100644
@@ -1216,14 +1216,9 @@ static int panic_print_set(const char *val, const struct kernel_param *kp)
 	return  param_set_ulong(val, kp);
 }
 
-static int panic_print_get(char *val, const struct kernel_param *kp)
-{
-	return  param_get_ulong(val, kp);
-}
-
 static const struct kernel_param_ops panic_print_ops = {
 	.set	= panic_print_set,
-	.get	= panic_print_get,
+	.get	= param_get_ulong,
 };
 __core_param_cb(panic_print, &panic_print_ops, &panic_print, 0644);
 
Signature · 1 line
2.43.5
Reviewed-by on v1 1/1
#1 lore raw

On 2 September 2026 12:48:51 BST, Feng Tang <[email protected]> wrote:

Feng!

Quoted 8 lines

panic_print_get() was introduced in commit 2683df6539cb ("panic: add note that 'panic_print' parameter is deprecated") to print out warning message of the deprecation of 'panic_print' on read access.

Since commit 90f3c123247e ("panic: only warn about deprecated panic_print on write access"), panic_print_get() wrapper is not needed anymore for read access, so remove it and use param_get_ulong() instead.

could you say that this is only a cleanup?

Quoted 12 lines

---
kernel/panic.c | 7 +------

1 file changed, 1 insertion(+), 6 deletions(-)
kernel/panic.c +0 -0
index 7dda841c16f9..50715f14cf04 100644
@@ -1216,14 +1216,9 @@ static int panic_print_set(const char *val, const struct kernel_param *kp)
 	return  param_set_ulong(val, kp);
 }

kernel/panic.c static int panic_print_set(const char *val, const struct kernel_param *kp) · line 1221

Quoted 10 lines
kernel/panic.c +1 -6
 
-static int panic_print_get(char *val, const struct kernel_param *kp)
-{
-	return  param_get_ulong(val, kp);
-}
-
 static const struct kernel_param_ops panic_print_ops = {
 	.set	= panic_print_set,
-	.get	= panic_print_get,
+	.get	= param_get_ulong,

Ack.

kernel/panic.c static int panic_print_set(const char *val, const struct kernel_param *kp) · line 1224

Quoted 4 lines
kernel/panic.c +0 -0
 };
 __core_param_cb(panic_print, &panic_print_ops, &panic_print, 0644);
 

--- Thanks!
https://lore.kernel.org/all/[email protected]/

Reviewed-by on v1 1/1
#2 lore raw
In reply to Feng Tang
Quoted 9 lines · Feng Tang

panic_print_get() was introduced in commit 2683df6539cb ("panic: add note that 'panic_print' parameter is deprecated") to print out warning message of the deprecation of 'panic_print' on read access.

Since commit 90f3c123247e ("panic: only warn about deprecated panic_print on write access"), panic_print_get() wrapper is not needed anymore for read access, so remove it and use param_get_ulong() instead.

Nice cleanup.

Best Regards,
Petr