Messages in this thread Patch in this message | | | From | Qian Cai <> | Subject | [PATCH] tracing: Fix a unused variable compiling warning | Date | Mon, 25 Oct 2021 16:07:48 -0400 |
| |
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
| |