diff mbox series

[-next] function_graph: Remove the unused variable func

Message ID 20250307021412.119107-1-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Under Review
Headers show
Series [-next] function_graph: Remove the unused variable func | expand

Commit Message

Jiapeng Chong March 7, 2025, 2:14 a.m. UTC
Variable func is not effectively used, so delete it.

kernel/trace/trace_functions_graph.c:925:16: warning: variable ‘func’ set but not used.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=19250
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 kernel/trace/trace_functions_graph.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Steven Rostedt March 7, 2025, 3:43 a.m. UTC | #1
On Fri,  7 Mar 2025 10:14:12 +0800
Jiapeng Chong <jiapeng.chong@linux.alibaba.com> wrote:

> Variable func is not effectively used, so delete it.
> 
> kernel/trace/trace_functions_graph.c:925:16: warning: variable ‘func’ set but not used.

Thanks, but it should be stated that the variable "func" which came
from "call->func" was replaced by "ret_func" coming from
"graph_ret->func" but "func" wasn't removed after the replacement.

Also:

Fixes: ff5c9c576e754 ("ftrace: Add support for function argument to graph tracer")

You don't need to resend. I'll take the patch and update the change log.

-- Steve

> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=19250
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  kernel/trace/trace_functions_graph.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
> index 71b2fb068b6b..ed61ff719aa4 100644
> --- a/kernel/trace/trace_functions_graph.c
> +++ b/kernel/trace/trace_functions_graph.c
> @@ -922,7 +922,6 @@ print_graph_entry_leaf(struct trace_iterator *iter,
>  	struct ftrace_graph_ent *call;
>  	unsigned long long duration;
>  	unsigned long ret_func;
> -	unsigned long func;
>  	int args_size;
>  	int cpu = iter->cpu;
>  	int i;
> @@ -933,8 +932,6 @@ print_graph_entry_leaf(struct trace_iterator *iter,
>  	call = &entry->graph_ent;
>  	duration = ret_entry->rettime - ret_entry->calltime;
>  
> -	func = call->func + iter->tr->text_delta;
> -
>  	if (data) {
>  		struct fgraph_cpu_data *cpu_data;
>
diff mbox series

Patch

diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 71b2fb068b6b..ed61ff719aa4 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -922,7 +922,6 @@  print_graph_entry_leaf(struct trace_iterator *iter,
 	struct ftrace_graph_ent *call;
 	unsigned long long duration;
 	unsigned long ret_func;
-	unsigned long func;
 	int args_size;
 	int cpu = iter->cpu;
 	int i;
@@ -933,8 +932,6 @@  print_graph_entry_leaf(struct trace_iterator *iter,
 	call = &entry->graph_ent;
 	duration = ret_entry->rettime - ret_entry->calltime;
 
-	func = call->func + iter->tr->text_delta;
-
 	if (data) {
 		struct fgraph_cpu_data *cpu_data;