linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tracing: Fix a unused variable compiling warning
@ 2021-10-25 20:07 Qian Cai
  0 siblings, 0 replies; only message in thread
From: Qian Cai @ 2021-10-25 20:07 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar; +Cc: linux-kernel, Qian Cai

tracing_max_lat_fops is only used when LATENCY_FS_NOTIFY is set. Otherwise,
W=1 compiling could generate a warning.

kernel/trace/trace.c:1668:37: warning: 'tracing_max_lat_fops' defined but
not used [-Wunused-const-variable=]
 1668 | static const struct file_operations tracing_max_lat_fops;
      |                                     ^~~~~~~~~~~~~~~~~~~~

Fixes: 6880c987e451 ("tracing: Add LATENCY_FS_NOTIFY to define if latency_fsnotify() is defined")
Signed-off-by: Qian Cai <quic_qiancai@quicinc.com>
---
 kernel/trace/trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index c88bbfe75d1d..7f0801662a6b 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1665,10 +1665,10 @@ static ssize_t trace_seq_to_buffer(struct trace_seq *s, void *buf, size_t cnt)
 }
 
 unsigned long __read_mostly	tracing_thresh;
-static const struct file_operations tracing_max_lat_fops;
 
 #ifdef LATENCY_FS_NOTIFY
 
+static const struct file_operations tracing_max_lat_fops;
 static struct workqueue_struct *fsnotify_wq;
 
 static void latency_fsnotify_workfn(struct work_struct *work)
-- 
2.30.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-25 20:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 20:07 [PATCH] tracing: Fix a unused variable compiling warning Qian Cai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).