[PATCH] arm64: cpufeature: fix unused function warning

Catalin Marinas catalin.marinas at arm.com
Mon Dec 7 13:19:31 EST 2020


On Fri, Dec 04, 2020 at 09:59:10AM +0000, Will Deacon wrote:
> On Thu, Dec 03, 2020 at 11:32:11PM +0100, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd at 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 at arndb.de>

I already queued a fix from Mark: 701f49065e68 ("arm64: mark
__system_matches_cap as __maybe_unused").

> Acked-by: Will Deacon <will at kernel.org>
> 
> We can probably go further and remove the helper altogether as I don't
> think it really helps has_generic_auth(), but this should fix the warning.

We could replace the ARM64_HAS_GENERIC_AUTH checks with a single helper
function that tests for ARM64_HAS_GENERIC_AUTH_ARCH or
ARM64_HAS_GENERIC_AUTH_IMP_DEF. Or you had a different idea?

-- 
Catalin



More information about the linux-arm-kernel mailing list