Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp146574lql; Fri, 12 Apr 2024 06:29:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVBN45k3GJUhNmGtW10Fv8x2vS1qIx7kPQZx2vy427T4GMe+RK6Vk5+8ijRGcHrDlJL+4MbjoIkYWSVSPJM337yFhLN/p5S6dRkWCv3zQ== X-Google-Smtp-Source: AGHT+IE6kVde0u9Mvwy06wYF9cPBSxj8fKDcWDevkuAs1dQBTPX1SJX2bwLuVH7sonRudPl8z0pN X-Received: by 2002:a05:6512:74:b0:518:9ce1:a5bb with SMTP id i20-20020a056512007400b005189ce1a5bbmr75869lfo.54.1712928595823; Fri, 12 Apr 2024 06:29:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712928595; cv=pass; d=google.com; s=arc-20160816; b=ioXt6TvlhEUgMfW07CWUDa8F1/Q8AQdbbrWaM8qNMMfhhbuwrw3OZGpHY5urMpMwk0 QmxQaPoIfhZBstbrTQ46/jOipdFR+ARj1RdOr4oJf/DJ81lbp+AsW/6QSHuTlt095dZJ 8c0WlPpyp5GcTn9V7pw7WlHkxvDeKUn/htM1m1UJMs8Aa4iuOeoGRfyBh5CVgsOBhsh1 1CR+2NdrIbAbUdkr1WTrcj8h/Y4aAEk6Ax37vNihMaNoeUGgQloo5qFr7QuV0TBbKnAj jBJWTnvREOql9EsTDwKj+wW8BAhDGp2KR+aINTtT7PnMXVlFJJFU3FBVa5HgzMnL3jUa KD3w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:subject:cc:to:from:date:user-agent:message-id; bh=vO/J3/U7dmjGM3Qdj9NEs/xJmfx/hyTw5O16MhKl1gE=; fh=nUUZoLksMqaV6jMomv8haX2vLmHoxo7u7uZVE6gjq7g=; b=dk5Apz1MAGgCLg2iSukb7ol1zVoVEEcKZ7I0icRipB15U9lrOuYeinB0Lt1d6DAPaW SmlAol3jFIEe8jno9evUBwkXBHsdHA1QRP8XxcYGr73oxMu6OBeIj4dPPaBaUc/LKeR5 GsG44lm28WfajXA9fZvlbuES0/J8YXU6qs5vRxkkx2lqILnNMYUerLvnEiEO3rXRZ2Hz pyBbG8L6ToHpvjSDWxQ5epBwBpuKH/B0EVerlib1EZKApd1ABQ+3v/VxAPj3Q2wsGweg 0J1YSLxIJaozyIFQV3mZn/gEnC7n3K0c46xW6AOUY93HW8dE4BrsdmWaYV9+R8jrv8YE 9w9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-142726-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142726-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id x21-20020a170906b09500b00a46a922ddebsi1692865ejy.642.2024.04.12.06.29.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 06:29:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142726-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-142726-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142726-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 870491F216D4 for ; Fri, 12 Apr 2024 13:29:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 61973839F5; Fri, 12 Apr 2024 13:29:33 +0000 (UTC) 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 From: Arnd Bergmann 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) --- 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, 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