diff mbox series

tracing/synthetic: Make lastcmd_mutex static

Message ID 20230406111033.6e26de93@gandalf.local.home (mailing list archive)
State Accepted
Commit 31c683967174b487939efaf65e41f5ff1404e141
Headers show
Series tracing/synthetic: Make lastcmd_mutex static | expand

Commit Message

Steven Rostedt April 6, 2023, 3:10 p.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

The lastcmd_mutex is only used in trace_events_synth.c and should be
static.

Link: https://lore.kernel.org/linux-trace-kernel/202304062033.cRStgOuP-lkp@intel.com/

Fixes: 4ccf11c4e8a8e ("tracing/synthetic: Fix races on freeing last_cmd")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 kernel/trace/trace_events_synth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mukesh Ojha April 6, 2023, 3:33 p.m. UTC | #1
On 4/6/2023 8:40 PM, Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> 
> The lastcmd_mutex is only used in trace_events_synth.c and should be
> static.
> 
> Link: https://lore.kernel.org/linux-trace-kernel/202304062033.cRStgOuP-lkp@intel.com/
> 
> Fixes: 4ccf11c4e8a8e ("tracing/synthetic: Fix races on freeing last_cmd")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

You have just beat me in pushing this.

Reviewed-by: Mukesh Ojha <quic_mojha@quicinc.com>

-- Mukesh

> ---
>   kernel/trace/trace_events_synth.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c
> index f0ff730125bf..d6a70aff2410 100644
> --- a/kernel/trace/trace_events_synth.c
> +++ b/kernel/trace/trace_events_synth.c
> @@ -44,7 +44,7 @@ enum { ERRORS };
>   
>   static const char *err_text[] = { ERRORS };
>   
> -DEFINE_MUTEX(lastcmd_mutex);
> +static DEFINE_MUTEX(lastcmd_mutex);
>   static char *last_cmd;
>   
>   static int errpos(const char *str)
diff mbox series

Patch

diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c
index f0ff730125bf..d6a70aff2410 100644
--- a/kernel/trace/trace_events_synth.c
+++ b/kernel/trace/trace_events_synth.c
@@ -44,7 +44,7 @@  enum { ERRORS };
 
 static const char *err_text[] = { ERRORS };
 
-DEFINE_MUTEX(lastcmd_mutex);
+static DEFINE_MUTEX(lastcmd_mutex);
 static char *last_cmd;
 
 static int errpos(const char *str)