From patchwork Thu Dec 3 22:32:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11949793 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67A57C4361A for ; Thu, 3 Dec 2020 22:33:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 084D0223C8 for ; Thu, 3 Dec 2020 22:33:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 084D0223C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=kGn9yS0EZU+VDJKTIQOYosHbAjzbVFddpX/P2GsPI5g=; b=WmNZnenAT5VEZpLi6f79JOGox1 y7qxKFqRM2AeLkIlgnen68PltRELFmHnb7HXawcrWSvPANZ0UT/f6S+oBfdz1DZGEciZPvXammYmw x9UvNioT8guU05hUkTvEaLfUFRlPoL1mz1mmEAGtsom42tN8WVNwcgU4xGhlaQf8EIJC7EAn2pc2F VXwWqntTfuTCpwjuGYaWmy/RjT7MXWvhoOtfF2ThGNahRTY6NzypexUZFUONaqmbPIlK6O1fCX5pm /YKYHeuv7NUinEXcSb/yfzuWbTf/qgdaUGlKQ/x3Ks7TGYsG9j6UjEQpeOG51UqMXDQoL99TDg/NW eR5eGd/A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkx9G-0005KT-GZ; Thu, 03 Dec 2020 22:32:26 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkx9D-0005I3-Ri for linux-arm-kernel@lists.infradead.org; Thu, 03 Dec 2020 22:32:24 +0000 From: Arnd Bergmann Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: Catalin Marinas , Will Deacon , Mark Rutland Subject: [PATCH] arm64: cpufeature: fix unused function warning Date: Thu, 3 Dec 2020 23:32:11 +0100 Message-Id: <20201203223217.1238899-1-arnd@kernel.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201203_173224_054540_421FC10E X-CRM114-Status: GOOD ( 16.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Anshuman Khandual , Suzuki K Poulose , linux-kernel@vger.kernel.org, Kristina Martsenko , Mark Brown , Amit Daniel Kachhap , Ionela Voinescu , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Arnd Bergmann The __system_matches_cap() function is now only used in an #ifdef section: arch/arm64/kernel/cpufeature.c:2649:13: error: unused function '__system_matches_cap' [-Werror,-Wunused-function] Move it into that #ifdef section. Fixes: 7cf283c7bd62 ("arm64: uaccess: remove redundant PAN toggling") Signed-off-by: Arnd Bergmann Acked-by: Will Deacon --- arch/arm64/kernel/cpufeature.c | 36 ++++++++++++++++------------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 6bdb03400581..2c4e526c6e78 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -156,8 +156,6 @@ EXPORT_SYMBOL(cpu_hwcap_keys); static void cpu_enable_cnp(struct arm64_cpu_capabilities const *cap); -static bool __system_matches_cap(unsigned int n); - /* * NOTE: Any changes to the visibility of features should be kept in * sync with the documentation of the CPU feature register ABI. @@ -1617,6 +1615,23 @@ static void cpu_clear_disr(const struct arm64_cpu_capabilities *__unused) #endif /* CONFIG_ARM64_RAS_EXTN */ #ifdef CONFIG_ARM64_PTR_AUTH +/* + * This helper function is used in a narrow window when, + * - The system wide safe registers are set with all the SMP CPUs and, + * - The SYSTEM_FEATURE cpu_hwcaps may not have been set. + * In all other cases cpus_have_{const_}cap() should be used. + */ +static bool __system_matches_cap(unsigned int n) +{ + if (n < ARM64_NCAPS) { + const struct arm64_cpu_capabilities *cap = cpu_hwcaps_ptrs[n]; + + if (cap) + return cap->matches(cap, SCOPE_SYSTEM); + } + return false; +} + static bool has_address_auth_cpucap(const struct arm64_cpu_capabilities *entry, int scope) { int boot_val, sec_val; @@ -2640,23 +2655,6 @@ bool this_cpu_has_cap(unsigned int n) return false; } -/* - * This helper function is used in a narrow window when, - * - The system wide safe registers are set with all the SMP CPUs and, - * - The SYSTEM_FEATURE cpu_hwcaps may not have been set. - * In all other cases cpus_have_{const_}cap() should be used. - */ -static bool __system_matches_cap(unsigned int n) -{ - if (n < ARM64_NCAPS) { - const struct arm64_cpu_capabilities *cap = cpu_hwcaps_ptrs[n]; - - if (cap) - return cap->matches(cap, SCOPE_SYSTEM); - } - return false; -} - void cpu_set_feature(unsigned int num) { WARN_ON(num >= MAX_CPU_FEATURES);