[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20200417073932.45616-1-yanaijie@huawei.com>
Date: Fri, 17 Apr 2020 15:39:32 +0800
From: Jason Yan <yanaijie@...wei.com>
To: <yanaijie@...wei.com>, <linux-kernel@...r.kernel.org>
CC: Hulk Robot <hulkci@...wei.com>
Subject: [PATCH] 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?
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Jason Yan <yanaijie@...wei.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
Powered by blists - more mailing lists