Skip to content

Commit

Permalink
tracing/osnoise: set several trace_osnoise.c variables storage-class-…
Browse files Browse the repository at this point in the history
…specifier to static

smatch reports several similar warnings
kernel/trace/trace_osnoise.c:220:1: warning:
  symbol '__pcpu_scope_per_cpu_osnoise_var' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:243:1: warning:
  symbol '__pcpu_scope_per_cpu_timerlat_var' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:335:14: warning:
  symbol 'interface_lock' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:2242:5: warning:
  symbol 'timerlat_min_period' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:2243:5: warning:
  symbol 'timerlat_max_period' was not declared. Should it be static?

These variables are only used in trace_osnoise.c, so it should be static

Link: https://lore.kernel.org/linux-trace-kernel/20230309150414.4036764-1-trix@redhat.com

Signed-off-by: Tom Rix <trix@redhat.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Acked-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
  • Loading branch information
Tom Rix authored and rostedt committed Mar 19, 2023
1 parent bc4f359 commit 7a025e0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kernel/trace/trace_osnoise.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ struct osnoise_variables {
/*
* Per-cpu runtime information.
*/
DEFINE_PER_CPU(struct osnoise_variables, per_cpu_osnoise_var);
static DEFINE_PER_CPU(struct osnoise_variables, per_cpu_osnoise_var);

/*
* this_cpu_osn_var - Return the per-cpu osnoise_variables on its relative CPU
Expand All @@ -240,7 +240,7 @@ struct timerlat_variables {
u64 count;
};

DEFINE_PER_CPU(struct timerlat_variables, per_cpu_timerlat_var);
static DEFINE_PER_CPU(struct timerlat_variables, per_cpu_timerlat_var);

/*
* this_cpu_tmr_var - Return the per-cpu timerlat_variables on its relative CPU
Expand Down Expand Up @@ -332,7 +332,7 @@ struct timerlat_sample {
/*
* Protect the interface.
*/
struct mutex interface_lock;
static struct mutex interface_lock;

/*
* Tracer data.
Expand Down Expand Up @@ -2239,8 +2239,8 @@ static struct trace_min_max_param osnoise_print_stack = {
/*
* osnoise/timerlat_period: min 100 us, max 1 s
*/
u64 timerlat_min_period = 100;
u64 timerlat_max_period = 1000000;
static u64 timerlat_min_period = 100;
static u64 timerlat_max_period = 1000000;
static struct trace_min_max_param timerlat_period = {
.lock = &interface_lock,
.val = &osnoise_data.timerlat_period,
Expand Down

0 comments on commit 7a025e0

Please sign in to comment.