[PATCH] kernel/params: fix a pr_debug(" %p ") in parse_one()

From: Jim Cromie

Date: Thu Jun 18 2026 - 15:07:34 EST


Inside parse_one(), the core parameter-parsing engine prints the
address of the parameter-set callback function using %p:
pr_debug("handling %s with %p\n", param, params[i].ops->set);

Since the string value of the parameter being parsed (val) is already
available, print the parameter name and its value instead, and avoid
tainting the kernel by exposing a kernel-ptr.

Signed-off-by: Jim Cromie <jim.cromie@xxxxxxxxx>
---
kernel/params.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/params.c b/kernel/params.c
index 74d620bc2521..01d4e6704ebc 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -136,8 +136,8 @@ static int parse_one(char *param,
if (!val &&
!(params[i].ops->flags & KERNEL_PARAM_OPS_FL_NOARG))
return -EINVAL;
- pr_debug("handling %s with %p\n", param,
- params[i].ops->set);
+ pr_debug("handling %s with value '%s'\n", param,
+ val ? val : "no-arg");
kernel_param_lock(params[i].mod);
if (param_check_unsafe(&params[i]))
err = params[i].ops->set(val, &params[i]);
--
2.54.0