lkml.org 
[lkml]   [2020]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] samples/trace_printk: make some symbols static
Date
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?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
samples/trace_printk/trace-printk.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/samples/trace_printk/trace-printk.c b/samples/trace_printk/trace-printk.c
index cfc159580263..e9bae541905e 100644
--- a/samples/trace_printk/trace-printk.c
+++ b/samples/trace_printk/trace-printk.c
@@ -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;
--
2.21.1
\
 
 \ /
  Last update: 2020-04-17 09:15    [W:0.026 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site