Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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/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>

authored by

Tom Rix and committed by
Steven Rostedt (Google)
7a025e06 bc4f359b

+5 -5
+5 -5
kernel/trace/trace_osnoise.c
··· 217 217 /* 218 218 * Per-cpu runtime information. 219 219 */ 220 - DEFINE_PER_CPU(struct osnoise_variables, per_cpu_osnoise_var); 220 + static DEFINE_PER_CPU(struct osnoise_variables, per_cpu_osnoise_var); 221 221 222 222 /* 223 223 * this_cpu_osn_var - Return the per-cpu osnoise_variables on its relative CPU ··· 240 240 u64 count; 241 241 }; 242 242 243 - DEFINE_PER_CPU(struct timerlat_variables, per_cpu_timerlat_var); 243 + static DEFINE_PER_CPU(struct timerlat_variables, per_cpu_timerlat_var); 244 244 245 245 /* 246 246 * this_cpu_tmr_var - Return the per-cpu timerlat_variables on its relative CPU ··· 332 332 /* 333 333 * Protect the interface. 334 334 */ 335 - struct mutex interface_lock; 335 + static struct mutex interface_lock; 336 336 337 337 /* 338 338 * Tracer data. ··· 2239 2239 /* 2240 2240 * osnoise/timerlat_period: min 100 us, max 1 s 2241 2241 */ 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; 2244 2244 static struct trace_min_max_param timerlat_period = { 2245 2245 .lock = &interface_lock, 2246 2246 .val = &osnoise_data.timerlat_period,