linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] tracing: Remove set but not used variable 'ret'
@ 2021-05-27  9:10 Baokun Li
  2021-06-15  1:59 ` libaokun (A)
  0 siblings, 1 reply; 4+ messages in thread
From: Baokun Li @ 2021-05-27  9:10 UTC (permalink / raw)
  To: rostedt, mingo, linux-kernel
  Cc: weiyongjun1, yuehaibing, yangjihong1, yukuai3, libaokun1

Fixes gcc '-Wunused-but-set-variable' warning:

kernel/trace/trace_events_hist.c: In function 'unregister_field_var_hists':
kernel/trace/trace_events_hist.c:5228:6: warning:
 variable ‘ret’ set but not used [-Wunused-but-set-variable]

It never used since introduction.

Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
 kernel/trace/trace_events_hist.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index c1abd63f1d6c..af4da32f7eab 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -5225,13 +5225,12 @@ static void unregister_field_var_hists(struct hist_trigger_data *hist_data)
 	struct trace_event_file *file;
 	unsigned int i;
 	char *cmd;
-	int ret;
 
 	for (i = 0; i < hist_data->n_field_var_hists; i++) {
 		file = hist_data->field_var_hists[i]->hist_data->event_file;
 		cmd = hist_data->field_var_hists[i]->cmd;
-		ret = event_hist_trigger_func(&trigger_hist_cmd, file,
-					      "!hist", "hist", cmd);
+		event_hist_trigger_func(&trigger_hist_cmd, file,
+					"!hist", "hist", cmd);
 	}
 }
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] tracing: Remove set but not used variable 'ret'
  2021-05-27  9:10 [PATCH -next] tracing: Remove set but not used variable 'ret' Baokun Li
@ 2021-06-15  1:59 ` libaokun (A)
  2021-06-15 15:39   ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: libaokun (A) @ 2021-06-15  1:59 UTC (permalink / raw)
  To: rostedt, mingo, linux-kernel
  Cc: weiyongjun1, yuehaibing, yangjihong1, yukuai3

ping

在 2021/5/27 17:10, Baokun Li 写道:
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> kernel/trace/trace_events_hist.c: In function 'unregister_field_var_hists':
> kernel/trace/trace_events_hist.c:5228:6: warning:
>   variable ‘ret’ set but not used [-Wunused-but-set-variable]
>
> It never used since introduction.
>
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> ---
>   kernel/trace/trace_events_hist.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
> index c1abd63f1d6c..af4da32f7eab 100644
> --- a/kernel/trace/trace_events_hist.c
> +++ b/kernel/trace/trace_events_hist.c
> @@ -5225,13 +5225,12 @@ static void unregister_field_var_hists(struct hist_trigger_data *hist_data)
>   	struct trace_event_file *file;
>   	unsigned int i;
>   	char *cmd;
> -	int ret;
>   
>   	for (i = 0; i < hist_data->n_field_var_hists; i++) {
>   		file = hist_data->field_var_hists[i]->hist_data->event_file;
>   		cmd = hist_data->field_var_hists[i]->cmd;
> -		ret = event_hist_trigger_func(&trigger_hist_cmd, file,
> -					      "!hist", "hist", cmd);
> +		event_hist_trigger_func(&trigger_hist_cmd, file,
> +					"!hist", "hist", cmd);
>   	}
>   }
>   

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] tracing: Remove set but not used variable 'ret'
  2021-06-15  1:59 ` libaokun (A)
@ 2021-06-15 15:39   ` Steven Rostedt
  2021-06-16  1:11     ` libaokun (A)
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2021-06-15 15:39 UTC (permalink / raw)
  To: libaokun (A)
  Cc: mingo, linux-kernel, weiyongjun1, yuehaibing, yangjihong1, yukuai3

On Tue, 15 Jun 2021 09:59:10 +0800
"libaokun (A)" <libaokun1@huawei.com> wrote:

> ping
> 
> 在 2021/5/27 17:10, Baokun Li 写道:
> > Fixes gcc '-Wunused-but-set-variable' warning:
> >
> > kernel/trace/trace_events_hist.c: In function 'unregister_field_var_hists':
> > kernel/trace/trace_events_hist.c:5228:6: warning:
> >   variable ‘ret’ set but not used [-Wunused-but-set-variable]
> >
> > It never used since introduction.

Which was a bug.

> >
> > Signed-off-by: Baokun Li <libaokun1@huawei.com>
> 

This was fixed differently:

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=6c610dba6e2beb1a16ac309672181d0090fb8d30

-- Steve

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] tracing: Remove set but not used variable 'ret'
  2021-06-15 15:39   ` Steven Rostedt
@ 2021-06-16  1:11     ` libaokun (A)
  0 siblings, 0 replies; 4+ messages in thread
From: libaokun (A) @ 2021-06-16  1:11 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: mingo, linux-kernel, weiyongjun1, yuehaibing, yangjihong1, yukuai3

Thank you for your reminder.

Best Regards.


在 2021/6/15 23:39, Steven Rostedt 写道:
> On Tue, 15 Jun 2021 09:59:10 +0800
> "libaokun (A)" <libaokun1@huawei.com> wrote:
>
>> ping
>>
>> 在 2021/5/27 17:10, Baokun Li 写道:
>>> Fixes gcc '-Wunused-but-set-variable' warning:
>>>
>>> kernel/trace/trace_events_hist.c: In function 'unregister_field_var_hists':
>>> kernel/trace/trace_events_hist.c:5228:6: warning:
>>>    variable ‘ret’ set but not used [-Wunused-but-set-variable]
>>>
>>> It never used since introduction.
> Which was a bug.
>
>>> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> This was fixed differently:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=6c610dba6e2beb1a16ac309672181d0090fb8d30
>
> -- Steve
> .

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-16  1:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-27  9:10 [PATCH -next] tracing: Remove set but not used variable 'ret' Baokun Li
2021-06-15  1:59 ` libaokun (A)
2021-06-15 15:39   ` Steven Rostedt
2021-06-16  1:11     ` libaokun (A)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).