[PATCH] tracing: Fix a unused variable compiling warning

From: Qian Cai
Date: Mon Oct 25 2021 - 16:08:50 EST


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@xxxxxxxxxxx>
---
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