Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2557965lqz; Wed, 3 Apr 2024 01:17:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUYshirRGKEH++EOnwVxgOcioMAC3dIwmnXgS+XMQHTv8qsPSma29u94BKRgIH/CAi1z7F6p+VOyrzx1mJIDze831RB+X/MQVkBD0dDlA== X-Google-Smtp-Source: AGHT+IGaFcLmap/hdZ2+m+A2vUbcqnPR9AtF6TlZOr0A2a7I8IXvDlrLX6flFEPKZMy3I1YBvuzb X-Received: by 2002:a05:6402:2790:b0:56c:195d:b162 with SMTP id b16-20020a056402279000b0056c195db162mr2021752ede.6.1712132249576; Wed, 03 Apr 2024 01:17:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712132249; cv=pass; d=google.com; s=arc-20160816; b=JRLq3v14f8WVTp7v6zXyraSlUaveKcmXAtGXJdXldoUBSU9r+4QhjeeSEsqUfy9Nt2 NU/u7CuNruHUTWXvXWTOpkz8plD55iVyIjjlHjzYfInjdsK3flp48EGUCfMXX2Nmk3EG iDJVYYcsAoyJu/qjbAr3L5KfNtV3RC6LAS2ri6rDkSviCuSHMO1IASgPAG0vKSaEPxrM X5ILPxJtx+YeSrOCyaHu+Z1tNLtxBJD5JsE5auIb+f6LrX7FgnzjGs3pbbO4icdddzMV huBcMIghRNM2UeATe8aBF+5hBGYQS5cW7IginjRMBVOh8+mV5UvTDgij7rWOlU544oBw 94Sw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=G0ZggalNH2GSe+0YL/ZRtFTo6MqLJwxXI77JQk0lPYM=; fh=vt0/yicfkPbBFxkTNR2wgihxfR9oGDGHiTNvkOudKaA=; b=PnKKQvSk08u7ohYABD7OZ2j4cBVil53W5Gt4dYwhoPXH7jdjj3+/TDgiHL+OttVhBE 1QnVZezLsegPONtvq7WbBBBY9JWUm/9nRER8MjccHf2pqQDpE+X+tzebYND247cHzvJW 4p6XK/iyOFGo+Ptj3xUpjHInw4JI2JQ2g1kwoRMyDzJ31wfY7Od5iOIh0ZfNpn/plfZe 2y2q/KPP17pIVFMDEYg2jJYxMqwOGLFu3Cjr4JBkchWXDBo53D0QER7EvL81sH6RbOGN 6XerC3uh426wu0kOCwas3c9F72Po4gVdJQHDrg204yqXmLr5dm5DmtQB+6kR4bn6yI7P CoVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="MND/xHM6"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-129283-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129283-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g5-20020a50d5c5000000b0056bf2f4438bsi6380759edj.307.2024.04.03.01.17.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 01:17:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-129283-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="MND/xHM6"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-129283-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129283-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 E010D1F21CCE for ; Wed, 3 Apr 2024 08:17:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35C2784D06; Wed, 3 Apr 2024 08:08:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MND/xHM6" 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 47ACD823DF; Wed, 3 Apr 2024 08:08: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=1712131712; cv=none; b=S48V1bhV10+i7NqaZpvu9nx4CTPU8/FzLEP0XRiIwIS0b+q8ZfU7D49T7/qLpjbFdSUikZIRRLCa/yE6KsLCW8jQfcVJliO3mUx84DyhcnAwPaGcoVGx6I9evQO1Hinifc7BD/67I1Fs3aU1tajk1R0QPdZ1V5tQPpoCcM84DKg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712131712; c=relaxed/simple; bh=l8thGNKJJbETb0CvQ4KQ0CUGk7po5gBhYYwAGbPFY2A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=H9FctXtTzcjzNiKIHsMqVuTU+DRBedbizp3VzJJSdAS2PJNgTIfqJvmeS9og7B9YmGN3FFemBZfQIHBUKEOX3Zq8VWOt0xq0pyotP0EJnxhBokmsA+sZkK5GfMHGK/51CXAFPgD7X1XwtoyoHfL4n/McXQJ0U+L9ugCqx90biNQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MND/xHM6; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4245AC433C7; Wed, 3 Apr 2024 08:08:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712131712; bh=l8thGNKJJbETb0CvQ4KQ0CUGk7po5gBhYYwAGbPFY2A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MND/xHM6qa2MiY9G7TJkiu2MvxTqZkG72ygQajBZtSk5mFy4ofP3WGbUTtdwp8qK1 UGLOouFC0JA6sgN3lgR6X1zdD3e+EjwLhuqnzPAn1lLtkxREZqOBYdz12TTokECuLE D0DZwJj0vWebcFS679BeDWzLOr8p4VEI1DNWcat81AK7BdJMSgYJWvHZz2nPdKCf2f 2ErVqjTKG647fLlxfy7JOGODAQWrLsByzOc2FlmGnzGm6lYNJ0fW16Sf+DZBxEsjl+ IXFdaCXcVAVMSR7l1/kjYCSAjOmDvnLCN5BzOKCvRFDx7x2lzvsz6eKHHWieOUMsUA lFZD2M2Ec4kqQ== From: Arnd Bergmann To: linux-kernel@vger.kernel.org, Steven Rostedt , Masami Hiramatsu , Oleg Nesterov Cc: Arnd Bergmann , Mathieu Desnoyers , Zheng Yejian , Kees Cook , Ajay Kaher , Jinjie Ruan , =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Dan Carpenter , "Tzvetomir Stoyanov (VMware)" , linux-trace-kernel@vger.kernel.org Subject: [PATCH 06/34] tracing: hide unused ftrace_event_id_fops Date: Wed, 3 Apr 2024 10:06:24 +0200 Message-Id: <20240403080702.3509288-7-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240403080702.3509288-1-arnd@kernel.org> References: <20240403080702.3509288-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Fixes: 620a30e97feb ("tracing: Don't pass file_operations array to event_create_dir()") Signed-off-by: Arnd Bergmann --- 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.39.2