Skip to content

Commit 7a025e0

Browse files
Tom Rixrostedt
authored andcommitted
tracing/osnoise: set several trace_osnoise.c variables storage-class-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/[email protected] Signed-off-by: Tom Rix <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Acked-by: Daniel Bristot de Oliveira <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent bc4f359 commit 7a025e0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

kernel/trace/trace_osnoise.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ struct osnoise_variables {
217217
/*
218218
* Per-cpu runtime information.
219219
*/
220-
DEFINE_PER_CPU(struct osnoise_variables, per_cpu_osnoise_var);
220+
static DEFINE_PER_CPU(struct osnoise_variables, per_cpu_osnoise_var);
221221

222222
/*
223223
* this_cpu_osn_var - Return the per-cpu osnoise_variables on its relative CPU
@@ -240,7 +240,7 @@ struct timerlat_variables {
240240
u64 count;
241241
};
242242

243-
DEFINE_PER_CPU(struct timerlat_variables, per_cpu_timerlat_var);
243+
static DEFINE_PER_CPU(struct timerlat_variables, per_cpu_timerlat_var);
244244

245245
/*
246246
* this_cpu_tmr_var - Return the per-cpu timerlat_variables on its relative CPU
@@ -332,7 +332,7 @@ struct timerlat_sample {
332332
/*
333333
* Protect the interface.
334334
*/
335-
struct mutex interface_lock;
335+
static struct mutex interface_lock;
336336

337337
/*
338338
* Tracer data.
@@ -2239,8 +2239,8 @@ static struct trace_min_max_param osnoise_print_stack = {
22392239
/*
22402240
* osnoise/timerlat_period: min 100 us, max 1 s
22412241
*/
2242-
u64 timerlat_min_period = 100;
2243-
u64 timerlat_max_period = 1000000;
2242+
static u64 timerlat_min_period = 100;
2243+
static u64 timerlat_max_period = 1000000;
22442244
static struct trace_min_max_param timerlat_period = {
22452245
.lock = &interface_lock,
22462246
.val = &osnoise_data.timerlat_period,

0 commit comments

Comments
 (0)