* [PATCH] tracing/probes: Delete dead code in trace_eprobe_tp_update_arg()
@ 2023-06-26 13:35 Dan Carpenter
2023-07-01 23:02 ` Masami Hiramatsu
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2023-06-26 13:35 UTC (permalink / raw)
To: Steven Rostedt, Masami Hiramatsu
Cc: linux-kernel, linux-trace-kernel, kernel-janitors
This code was recently refactored and now the "ret" variable is always
zero. Delete the check for non-zero.
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
This code was changed in 1b8b0cd754cd (tracing/probes: Move event
parameter fetching code to common parser)
kernel/trace/trace_eprobe.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/kernel/trace/trace_eprobe.c b/kernel/trace/trace_eprobe.c
index cb0077ba2b49..b5181d690b4d 100644
--- a/kernel/trace/trace_eprobe.c
+++ b/kernel/trace/trace_eprobe.c
@@ -797,10 +797,7 @@ static int trace_eprobe_tp_update_arg(struct trace_eprobe *ep, const char *argv[
return ret;
/* Handle symbols "@" */
- if (!ret)
- ret = traceprobe_update_arg(&ep->tp.args[i]);
-
- return ret;
+ return traceprobe_update_arg(&ep->tp.args[i]);
}
static int trace_eprobe_parse_filter(struct trace_eprobe *ep, int argc, const char *argv[])
--
2.39.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] tracing/probes: Delete dead code in trace_eprobe_tp_update_arg()
2023-06-26 13:35 [PATCH] tracing/probes: Delete dead code in trace_eprobe_tp_update_arg() Dan Carpenter
@ 2023-07-01 23:02 ` Masami Hiramatsu
2023-07-06 15:52 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Masami Hiramatsu @ 2023-07-01 23:02 UTC (permalink / raw)
To: Dan Carpenter
Cc: Steven Rostedt, linux-kernel, linux-trace-kernel, kernel-janitors
On Mon, 26 Jun 2023 16:35:06 +0300
Dan Carpenter <dan.carpenter@linaro.org> wrote:
> This code was recently refactored and now the "ret" variable is always
> zero. Delete the check for non-zero.
>
Good catch!
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> This code was changed in 1b8b0cd754cd (tracing/probes: Move event
> parameter fetching code to common parser)
OK, this will be picked to the 6.5 fix.
Thank you!
>
> kernel/trace/trace_eprobe.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/kernel/trace/trace_eprobe.c b/kernel/trace/trace_eprobe.c
> index cb0077ba2b49..b5181d690b4d 100644
> --- a/kernel/trace/trace_eprobe.c
> +++ b/kernel/trace/trace_eprobe.c
> @@ -797,10 +797,7 @@ static int trace_eprobe_tp_update_arg(struct trace_eprobe *ep, const char *argv[
> return ret;
>
> /* Handle symbols "@" */
> - if (!ret)
> - ret = traceprobe_update_arg(&ep->tp.args[i]);
> -
> - return ret;
> + return traceprobe_update_arg(&ep->tp.args[i]);
> }
>
> static int trace_eprobe_parse_filter(struct trace_eprobe *ep, int argc, const char *argv[])
> --
> 2.39.2
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] tracing/probes: Delete dead code in trace_eprobe_tp_update_arg()
2023-07-01 23:02 ` Masami Hiramatsu
@ 2023-07-06 15:52 ` Steven Rostedt
0 siblings, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2023-07-06 15:52 UTC (permalink / raw)
To: Masami Hiramatsu (Google)
Cc: Dan Carpenter, linux-kernel, linux-trace-kernel, kernel-janitors
On Sun, 2 Jul 2023 08:02:38 +0900
Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:
> On Mon, 26 Jun 2023 16:35:06 +0300
> Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> > This code was recently refactored and now the "ret" variable is always
> > zero. Delete the check for non-zero.
> >
Yep! The code use to be:
if (ep->tp.args[i].code->op == FETCH_OP_TP_ARG) {
ret = trace_eprobe_tp_arg_update(ep, i);
if (ret)
trace_probe_log_err(0, BAD_ATTACH_ARG);
}
/* Handle symbols "@" */
if (!ret)
ret = traceprobe_update_arg(&ep->tp.args[i]);
return ret;
}
and is now:
ret = traceprobe_parse_probe_arg(&ep->tp, i, argv[i], &ctx);
if (ret)
return ret;
/* Handle symbols "@" */
if (!ret)
ret = traceprobe_update_arg(&ep->tp.args[i]);
return ret;
}
so that last ret check is redundant.
>
> Good catch!
>
> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
>
> > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> > ---
> > This code was changed in 1b8b0cd754cd (tracing/probes: Move event
> > parameter fetching code to common parser)
>
> OK, this will be picked to the 6.5 fix.
Thanks Masami and Dan,
-- Steve
>
> Thank you!
>
> >
> > kernel/trace/trace_eprobe.c | 5 +----
> > 1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/kernel/trace/trace_eprobe.c b/kernel/trace/trace_eprobe.c
> > index cb0077ba2b49..b5181d690b4d 100644
> > --- a/kernel/trace/trace_eprobe.c
> > +++ b/kernel/trace/trace_eprobe.c
> > @@ -797,10 +797,7 @@ static int trace_eprobe_tp_update_arg(struct trace_eprobe *ep, const char *argv[
> > return ret;
> >
> > /* Handle symbols "@" */
> > - if (!ret)
> > - ret = traceprobe_update_arg(&ep->tp.args[i]);
> > -
> > - return ret;
> > + return traceprobe_update_arg(&ep->tp.args[i]);
> > }
> >
> > static int trace_eprobe_parse_filter(struct trace_eprobe *ep, int argc, const char *argv[])
> > --
> > 2.39.2
> >
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-07-06 15:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-26 13:35 [PATCH] tracing/probes: Delete dead code in trace_eprobe_tp_update_arg() Dan Carpenter
2023-07-01 23:02 ` Masami Hiramatsu
2023-07-06 15:52 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox