From: Arnd Bergmann <arnd@kernel.org>
To: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Anshuman Khandual <anshuman.khandual@arm.com>,
Ionela Voinescu <ionela.voinescu@arm.com>,
Mark Brown <broonie@kernel.org>,
Amit Daniel Kachhap <amit.kachhap@arm.com>,
Kristina Martsenko <kristina.martsenko@arm.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] arm64: cpufeature: fix unused function warning
Date: Thu, 3 Dec 2020 23:32:11 +0100 [thread overview]
Message-ID: <20201203223217.1238899-1-arnd@kernel.org> (raw)
From: Arnd Bergmann <arnd@arndb.de>
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 <arnd@arndb.de>
---
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);
--
2.27.0
next reply other threads:[~2020-12-03 22:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-03 22:32 Arnd Bergmann [this message]
2020-12-04 9:59 ` [PATCH] arm64: cpufeature: fix unused function warning Will Deacon
2020-12-07 18:19 ` Catalin Marinas
2020-12-08 10:03 ` Will Deacon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201203223217.1238899-1-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=amit.kachhap@arm.com \
--cc=anshuman.khandual@arm.com \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=ionela.voinescu@arm.com \
--cc=kristina.martsenko@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).