diff mbox series

arm64: mark __system_matches_cap as __maybe_unused

Message ID 20201203152403.26100-1-mark.rutland@arm.com (mailing list archive)
State New, archived
Headers show
Series arm64: mark __system_matches_cap as __maybe_unused | expand

Commit Message

Mark Rutland Dec. 3, 2020, 3:24 p.m. UTC
Hi Catalin,

Qian Cai reports the uaccess rework introduced a build-time warning in some
configurations; the below is a trivial fix -- could you please queue this atop
the other uaccess patches?

Thanks,
Mark.

---->8----
Now that the PAN toggling has been removed, the only user of
__system_matches_cap() is has_generic_auth(), which is only built when
CONFIG_ARM64_PTR_AUTH is selected, and Qian reports that this results in
a build-time warning when CONFIG_ARM64_PTR_AUTH is not selected:

| arch/arm64/kernel/cpufeature.c:2649:13: warning: '__system_matches_cap' defined but not used [-Wunused-function]
|  static bool __system_matches_cap(unsigned int n)
|              ^~~~~~~~~~~~~~~~~~~~

It's tricky to restructure things to prevent this, so let's mark
__system_matches_cap() as __maybe_unused, as we used to do for the other
user of __system_matches_cap() which we just removed.

Reported-by: Qian Cai <qcai@redhat.com>
Suggested-by: Qian Cai <qcai@redhat.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
---
 arch/arm64/kernel/cpufeature.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Catalin Marinas Dec. 3, 2020, 5:34 p.m. UTC | #1
On Thu, 3 Dec 2020 15:24:03 +0000, Mark Rutland wrote:
> Qian Cai reports the uaccess rework introduced a build-time warning in some
> configurations; the below is a trivial fix -- could you please queue this atop
> the other uaccess patches?
> 
> Thanks,
> Mark.
> 
> [...]

Applied to arm64 (for-next/uaccess), thanks!

[1/1] arm64: mark __system_matches_cap as __maybe_unused
      https://git.kernel.org/arm64/c/701f49065e68
diff mbox series

Patch

diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index cf09bac80adb..cffcb0198bae 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -2634,7 +2634,7 @@  bool this_cpu_has_cap(unsigned int n)
  * - 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)
+static bool __maybe_unused __system_matches_cap(unsigned int n)
 {
 	if (n < ARM64_NCAPS) {
 		const struct arm64_cpu_capabilities *cap = cpu_hwcaps_ptrs[n];