arm64: Remove system_uses_lse_atomics()
authorGavin Shan <gshan@redhat.com>
Tue, 17 Oct 2023 00:50:36 +0000 (10:50 +1000)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 18 Oct 2023 09:58:59 +0000 (10:58 +0100)
There are two variants of system_uses_lse_atomics(), depending on
CONFIG_ARM64_LSE_ATOMICS. The function isn't called anywhere when
CONFIG_ARM64_LSE_ATOMICS is disabled. It can be directly replaced
by alternative_has_cap_likely(ARM64_HAS_LSE_ATOMICS) when the kernel
option is enabled.

No need to keep system_uses_lse_atomics() and just remove it.

Signed-off-by: Gavin Shan <gshan@redhat.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20231017005036.334067-1-gshan@redhat.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/lse.h

index cbbcdc3..3129a58 100644 (file)
 #include <asm/atomic_lse.h>
 #include <asm/cpucaps.h>
 
-static __always_inline bool system_uses_lse_atomics(void)
-{
-       return alternative_has_cap_likely(ARM64_HAS_LSE_ATOMICS);
-}
-
 #define __lse_ll_sc_body(op, ...)                                      \
 ({                                                                     \
-       system_uses_lse_atomics() ?                                     \
+       alternative_has_cap_likely(ARM64_HAS_LSE_ATOMICS) ?             \
                __lse_##op(__VA_ARGS__) :                               \
                __ll_sc_##op(__VA_ARGS__);                              \
 })
@@ -34,8 +29,6 @@ static __always_inline bool system_uses_lse_atomics(void)
 
 #else  /* CONFIG_ARM64_LSE_ATOMICS */
 
-static inline bool system_uses_lse_atomics(void) { return false; }
-
 #define __lse_ll_sc_body(op, ...)              __ll_sc_##op(__VA_ARGS__)
 
 #define ARM64_LSE_ATOMIC_INSN(llsc, lse)       llsc