Skip to contentSkip to conversation

samples/trace_printk: make some symbols static

PATCH New Jason Yan 1 participant 1 message Apr 17, 2020

lore
Share & tools
lore

Jason Yan

author
#0 lore raw

PATCH 1/1 samples/trace_printk: make some symbols static

Fix the following sparse warning:

samples/trace_printk/trace-printk.c:7:6: warning: symbol 'trace_printk_test_global_str' was not declared. Should it be static? samples/trace_printk/trace-printk.c:10:6: warning: symbol 'trace_printk_test_global_str_irq' was not declared. Should it be static?
samples/trace_printk/trace-printk.c:13:6: warning: symbol 'trace_printk_test_global_str_fmt' was not declared. Should it be static?

---
 samples/trace_printk/trace-printk.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
samples/trace_printk/trace-printk.c +3 -3
index cfc159580263..e9bae541905e 100644
@@ -4,13 +4,13 @@
 #include <linux/irq_work.h>
 
 /* Must not be static to force gcc to consider these non constant */
-char *trace_printk_test_global_str =
+static char *trace_printk_test_global_str =
 	"This is a dynamic string that will use trace_puts\n";
 
-char *trace_printk_test_global_str_irq =
+static char *trace_printk_test_global_str_irq =
 	"(irq) This is a dynamic string that will use trace_puts\n";
 
-char *trace_printk_test_global_str_fmt =
+static char *trace_printk_test_global_str_fmt =
 	"%sThis is a %s that will use trace_printk\n";
 
 static struct irq_work irqwork;
Signature · 1 line
2.21.1