Skip to contentSkip to conversation

arm64: Remove system_uses_lse_atomics()

PATCH Applied Gavin Shan 3 participants 3 messages Oct 17, 2023 – Oct 18, 2023 arm64

lore
Share & tools
lore

Gavin Shan

author
#0 lore raw

PATCH 1/1 arm64: Remove system_uses_lse_atomics()

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.

---
 arch/arm64/include/asm/lse.h | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
arch/arm64/include/asm/lse.h +1 -8
index cbbcdc35c4cd..3129a5819d0e 100644
@@ -16,14 +16,9 @@
 #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
Signature · 7 lines
2.41.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Gavin Shan

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.

I had meant to remove this already, so:

Mark.

Quoted 36 lines
---
 arch/arm64/include/asm/lse.h | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
arch/arm64/include/asm/lse.h +1 -8
index cbbcdc35c4cd..3129a5819d0e 100644
@@ -16,14 +16,9 @@
 #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
Signature · 1 line
2.41.0
maintainer Applied
#2 lore raw
In reply to Gavin Shan
Quoted 9 lines · Gavin Shan

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.

[...]

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

[1/1] arm64: Remove system_uses_lse_atomics()

      https://git.kernel.org/arm64/c/0899a6278a86
Signature · 1 line
Catalin