[PATCH] tracing: probes: remove unused variable

Martin Kaiser posted 1 patch 1 month, 1 week ago
kernel/trace/trace_probe.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH] tracing: probes: remove unused variable
Posted by Martin Kaiser 1 month, 1 week ago
params is always NULL in traceprobe_expand_meta_args, it can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
Would it be better to return ERR_PTR(-EOPNOTSUPP) instead of NULL, similar to
what is done in other places where NOSUP_BTFARG is logged? This would make the
parsing fail if $arg* is used without BTF support. At the moment, we skip the
$arg*...

 kernel/trace/trace_probe.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index e0d3a0da26af..b627093a941e 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -1729,7 +1729,6 @@ const char **traceprobe_expand_meta_args(int argc, const char *argv[],
 					 int *new_argc, char *buf, int bufsize,
 					 struct traceprobe_parse_context *ctx)
 {
-	const struct btf_param *params = NULL;
 	int i, j, n, used, ret, args_idx = -1;
 	const char **new_argv __free(kfree) = NULL;
 
@@ -1747,7 +1746,7 @@ const char **traceprobe_expand_meta_args(int argc, const char *argv[],
 		if (args_idx != -1) {
 			/* $arg* requires BTF info */
 			trace_probe_log_err(0, NOSUP_BTFARG);
-			return (const char **)params;
+			return NULL;
 		}
 		*new_argc = argc;
 		return NULL;
-- 
2.43.7
Re: [PATCH] tracing: probes: remove unused variable
Posted by Markus Schneider-Pargmann 1 month, 1 week ago
On Sat May 2, 2026 at 3:57 PM CEST, Martin Kaiser wrote:
> params is always NULL in traceprobe_expand_meta_args, it can be removed.
>
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>

Reviewed-by: Markus Schneider-Pargmann (The Capable Hub) <msp@baylibre.com>

Best
Markus

> ---
> Would it be better to return ERR_PTR(-EOPNOTSUPP) instead of NULL, similar to
> what is done in other places where NOSUP_BTFARG is logged? This would make the
> parsing fail if $arg* is used without BTF support. At the moment, we skip the
> $arg*...
>
>  kernel/trace/trace_probe.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
> index e0d3a0da26af..b627093a941e 100644
> --- a/kernel/trace/trace_probe.c
> +++ b/kernel/trace/trace_probe.c
> @@ -1729,7 +1729,6 @@ const char **traceprobe_expand_meta_args(int argc, const char *argv[],
>  					 int *new_argc, char *buf, int bufsize,
>  					 struct traceprobe_parse_context *ctx)
>  {
> -	const struct btf_param *params = NULL;
>  	int i, j, n, used, ret, args_idx = -1;
>  	const char **new_argv __free(kfree) = NULL;
>  
> @@ -1747,7 +1746,7 @@ const char **traceprobe_expand_meta_args(int argc, const char *argv[],
>  		if (args_idx != -1) {
>  			/* $arg* requires BTF info */
>  			trace_probe_log_err(0, NOSUP_BTFARG);
> -			return (const char **)params;
> +			return NULL;
>  		}
>  		*new_argc = argc;
>  		return NULL;