From mboxrd@z Thu Jan 1 00:00:00 1970 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 218BB7FBBE; Mon, 15 Apr 2024 14:28:30 +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=1713191310; cv=none; b=QBYvPZPUtoDvzoqyW+NmM/5lenBKVvPEhbzn8b1C0rhLnnnr/aBK4vgHLMPwa6uTKtTVPlp+UBCz1LtdAurW3QoQv6sUyUd9hE/F7s4Ii//4b+wC1fQgPYld5fbry7HIMyMHFBWfoIl/KvpLwvG2ihPYGnYs7WCN+HrG4DnO3nQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713191310; c=relaxed/simple; bh=zt8KqiFeNGkHq0/SSiM8phbujEgveeF94hV+lzKrV3I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=I81sUaQDlsDt+00gOCJzIYY5uf6USiZaD/yOSB2hK/vmaLRc/PQzqsfjnxrcTeNodBRDaYNsgBrNesAEnVdpFfz9zfY+827GQck4p9Nf0dlaYkWKR+cy5Q5QJQOaha2hgKQwhh2vYHrJ3Ux8mc/impjEQJW3tgVRr+aOch5dxhc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kOy5VteQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="kOy5VteQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67EFBC32783; Mon, 15 Apr 2024 14:28:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1713191310; bh=zt8KqiFeNGkHq0/SSiM8phbujEgveeF94hV+lzKrV3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kOy5VteQ5mib0+LkN4b2pcNgiHW0l8iD09Rz+l4hs77cSFHwNyLhzgVHrv7VGvKxa ChgfEXO1X5SmTKv4Tb+sxl2AWSM5WFZ6ZA2ncdcFfSrhSILcwWCsCSNqh9/qiZxLk2 acDKJ8wcM/LQPVj+j50c+6nRAmXHAr3Pot5Qqrpw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Masami Hiramatsu , Oleg Nesterov , Mathieu Desnoyers , Zheng Yejian , Kees Cook , Ajay Kaher , Jinjie Ruan , =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Dan Carpenter , "Tzvetomir Stoyanov (VMware)" , Arnd Bergmann , "Steven Rostedt (Google)" , Sasha Levin Subject: [PATCH 6.8 102/172] tracing: hide unused ftrace_event_id_fops Date: Mon, 15 Apr 2024 16:20:01 +0200 Message-ID: <20240415142003.494518428@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415141959.976094777@linuxfoundation.org> References: <20240415141959.976094777@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.8-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann [ Upstream commit 5281ec83454d70d98b71f1836fb16512566c01cd ] When CONFIG_PERF_EVENTS, a 'make W=1' 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=unused-const-variable=] 2155 | static const struct file_operations ftrace_event_id_fops = { Hide this in the same #ifdef as the reference to it. Link: https://lore.kernel.org/linux-trace-kernel/20240403080702.3509288-7-arnd@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ément Léger Cc: Dan Carpenter Cc: "Tzvetomir Stoyanov (VMware)" Fixes: 620a30e97feb ("tracing: Don't pass file_operations array to event_create_dir()") Signed-off-by: Arnd Bergmann Signed-off-by: Steven Rostedt (Google) Signed-off-by: Sasha Levin --- 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 7c364b87352ee..52f75c36bbca4 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, struct file *file) return 0; } +#ifdef CONFIG_PERF_EVENTS static ssize_t event_id_read(struct file *filp, char __user *ubuf, size_t cnt, loff_t *ppos) { @@ -1684,6 +1685,7 @@ event_id_read(struct file *filp, char __user *ubuf, size_t cnt, loff_t *ppos) return simple_read_from_buffer(ubuf, cnt, ppos, buf, len); } +#endif 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_format_fops = { .release = seq_release, }; +#ifdef CONFIG_PERF_EVENTS static const struct file_operations ftrace_event_id_fops = { .read = event_id_read, .llseek = default_llseek, }; +#endif static const struct file_operations ftrace_event_filter_fops = { .open = tracing_open_file_tr, -- 2.43.0