From 590adf1ae6d9b7cfefab94db78191d8392f7a8d4 Mon Sep 17 00:00:00 2001 From: Jacky Liu Date: Tue, 10 Dec 2024 12:51:37 +0800 Subject: [PATCH] ANDROID: arm64: Suppress unused function error of cpus_have_cap() Out-of-tree fips140 modules may include asm/alternative-macros.h but not using any alternative_has_cap_*() macros, which results in the unused function error of cpus_have_cap(). For example, asm/alternative-macros.h could be unintentionally included through the following path: linux/bitops.h -> asm-generic/bitops/generic-non-atomic.h -> asm/barrier.h -> asm/alternative-macros.h Add __maybe_unused to the forward declaration of cpus_have_cap() to suppress the error. Fixes: 059d29197b8c ("ANDROID: arm64: only permit certain alternatives in the FIPS140 module") Bug: 383224684 Change-Id: I72d2b7e3b2923f29a5cdc524081cd785540db342 Signed-off-by: Jacky Liu --- arch/arm64/include/asm/alternative-macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/alternative-macros.h b/arch/arm64/include/asm/alternative-macros.h index 8f69660e7781..7ef7c43ce700 100644 --- a/arch/arm64/include/asm/alternative-macros.h +++ b/arch/arm64/include/asm/alternative-macros.h @@ -302,7 +302,7 @@ l_yes: #include -static bool cpus_have_cap(unsigned int num); +static bool __maybe_unused cpus_have_cap(unsigned int num); /* * Return 'false' for all capabilities listed above, and use the slow path for