From nobody Wed Feb 11 01:27:45 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C22EB824AD for ; Fri, 12 Apr 2024 13:29:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712928572; cv=none; b=um5pHqbknU1XRa8Wh6TtKPK7HyNowDGIl9xfKKn2HCCEfucqzKk9kN73UscDAqkkB/ov99YwGATZVsGqcMXME+VRy9OSel9N7Lf9PH5mr3qEL5n9a6Yu+J9x70Oq/TmKShERSpxCSXLTZhCMrLuw5JA+UfK/tddkrmQNwwhAhtc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712928572; c=relaxed/simple; bh=s92Y7fSnYxp/hAB13hJr+ejV7YBDYEZNITD0UOK91uE=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=DaqwizNwwrpRfQc3wWRjF2yg9dnExiY9okh+l0bu/nhh/wczuv/sryDjnCeYLddz3UMTw5cKesihN+CR1Wv7t27ORtlWzidb8H8jGdGupiy0NFxqGtZ4+nugfkGej979hT3+uefFbdOZih53a508CPzGZrKdfOvzYRcrFjdG7Iw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 633EFC32786; Fri, 12 Apr 2024 13:29:32 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rvH0o-000000012qQ-1Czq; Fri, 12 Apr 2024 09:32:14 -0400 Message-ID: <20240412133214.151885304@goodmis.org> User-Agent: quilt/0.67 Date: Fri, 12 Apr 2024 09:31:55 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Oleg Nesterov , Zheng Yejian , Kees Cook , Ajay Kaher , Jinjie Ruan , =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Dan Carpenter , "Tzvetomir Stoyanov (VMware)" , Arnd Bergmann Subject: [for-linus][PATCH 3/4] tracing: hide unused ftrace_event_id_fops References: <20240412133152.723632549@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Arnd Bergmann When CONFIG_PERF_EVENTS, a 'make W=3D1' build produces a warning about the unused ftrace_event_id_fops variable: kernel/trace/trace_events.c:2155:37: error: 'ftrace_event_id_fops' defined = but not used [-Werror=3Dunused-const-variable=3D] 2155 | static const struct file_operations ftrace_event_id_fops =3D { Hide this in the same #ifdef as the reference to it. Link: https://lore.kernel.org/linux-trace-kernel/20240403080702.3509288-7-a= rnd@kernel.org Cc: Masami Hiramatsu Cc: Oleg Nesterov Cc: Mathieu Desnoyers Cc: Zheng Yejian Cc: Kees Cook Cc: Ajay Kaher Cc: Jinjie Ruan Cc: Cl=C3=A9ment L=C3=A9ger Cc: Dan Carpenter Cc: "Tzvetomir Stoyanov (VMware)" Fixes: 620a30e97feb ("tracing: Don't pass file_operations array to event_cr= eate_dir()") Signed-off-by: Arnd Bergmann Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_events.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 7c364b87352e..52f75c36bbca 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -1670,6 +1670,7 @@ static int trace_format_open(struct inode *inode, str= uct file *file) return 0; } =20 +#ifdef CONFIG_PERF_EVENTS static ssize_t event_id_read(struct file *filp, char __user *ubuf, size_t cnt, loff_t *pp= os) { @@ -1684,6 +1685,7 @@ event_id_read(struct file *filp, char __user *ubuf, s= ize_t cnt, loff_t *ppos) =20 return simple_read_from_buffer(ubuf, cnt, ppos, buf, len); } +#endif =20 static ssize_t event_filter_read(struct file *filp, char __user *ubuf, size_t cnt, @@ -2152,10 +2154,12 @@ static const struct file_operations ftrace_event_fo= rmat_fops =3D { .release =3D seq_release, }; =20 +#ifdef CONFIG_PERF_EVENTS static const struct file_operations ftrace_event_id_fops =3D { .read =3D event_id_read, .llseek =3D default_llseek, }; +#endif =20 static const struct file_operations ftrace_event_filter_fops =3D { .open =3D tracing_open_file_tr, --=20 2.43.0