* [PATCH] arm64: atomics: lse: Remove unused parameters from ATOMIC_FETCH_OP_AND macros
[not found] <CGME20251126021037epcas1p2c5caf948ede87748ee1d4ef536a62126@epcas1p2.samsung.com>
@ 2025-11-26 2:10 ` Seongsu Park
2025-11-26 9:36 ` Mark Rutland
2025-11-27 19:15 ` Catalin Marinas
0 siblings, 2 replies; 3+ messages in thread
From: Seongsu Park @ 2025-11-26 2:10 UTC (permalink / raw)
To: will, peterz, boqun.feng, mark.rutland, gary, catalin.marinas
Cc: linux-kernel, linux-arm-kernel, Seongsu Park
The ATOMIC_FETCH_OP_AND and ATOMIC64_FETCH_OP_AND macros accept 'mb' and
'cl' parameters but never use them in their implementation. These macros
simply delegate to the corresponding andnot functions, which handle the
actual atomic operations and memory barriers.
Signed-off-by: Seongsu Park <sgsu.park@samsung.com>
---
arch/arm64/include/asm/atomic_lse.h | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/arch/arm64/include/asm/atomic_lse.h b/arch/arm64/include/asm/atomic_lse.h
index 87f568a94e55..afad1849c4cf 100644
--- a/arch/arm64/include/asm/atomic_lse.h
+++ b/arch/arm64/include/asm/atomic_lse.h
@@ -103,17 +103,17 @@ static __always_inline void __lse_atomic_and(int i, atomic_t *v)
return __lse_atomic_andnot(~i, v);
}
-#define ATOMIC_FETCH_OP_AND(name, mb, cl...) \
+#define ATOMIC_FETCH_OP_AND(name) \
static __always_inline int \
__lse_atomic_fetch_and##name(int i, atomic_t *v) \
{ \
return __lse_atomic_fetch_andnot##name(~i, v); \
}
-ATOMIC_FETCH_OP_AND(_relaxed, )
-ATOMIC_FETCH_OP_AND(_acquire, a, "memory")
-ATOMIC_FETCH_OP_AND(_release, l, "memory")
-ATOMIC_FETCH_OP_AND( , al, "memory")
+ATOMIC_FETCH_OP_AND(_relaxed)
+ATOMIC_FETCH_OP_AND(_acquire)
+ATOMIC_FETCH_OP_AND(_release)
+ATOMIC_FETCH_OP_AND( )
#undef ATOMIC_FETCH_OP_AND
@@ -210,17 +210,17 @@ static __always_inline void __lse_atomic64_and(s64 i, atomic64_t *v)
return __lse_atomic64_andnot(~i, v);
}
-#define ATOMIC64_FETCH_OP_AND(name, mb, cl...) \
+#define ATOMIC64_FETCH_OP_AND(name) \
static __always_inline long \
__lse_atomic64_fetch_and##name(s64 i, atomic64_t *v) \
{ \
return __lse_atomic64_fetch_andnot##name(~i, v); \
}
-ATOMIC64_FETCH_OP_AND(_relaxed, )
-ATOMIC64_FETCH_OP_AND(_acquire, a, "memory")
-ATOMIC64_FETCH_OP_AND(_release, l, "memory")
-ATOMIC64_FETCH_OP_AND( , al, "memory")
+ATOMIC64_FETCH_OP_AND(_relaxed)
+ATOMIC64_FETCH_OP_AND(_acquire)
+ATOMIC64_FETCH_OP_AND(_release)
+ATOMIC64_FETCH_OP_AND( )
#undef ATOMIC64_FETCH_OP_AND
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] arm64: atomics: lse: Remove unused parameters from ATOMIC_FETCH_OP_AND macros
2025-11-26 2:10 ` [PATCH] arm64: atomics: lse: Remove unused parameters from ATOMIC_FETCH_OP_AND macros Seongsu Park
@ 2025-11-26 9:36 ` Mark Rutland
2025-11-27 19:15 ` Catalin Marinas
1 sibling, 0 replies; 3+ messages in thread
From: Mark Rutland @ 2025-11-26 9:36 UTC (permalink / raw)
To: Seongsu Park
Cc: will, peterz, boqun.feng, gary, catalin.marinas, linux-kernel,
linux-arm-kernel
On Wed, Nov 26, 2025 at 11:10:25AM +0900, Seongsu Park wrote:
> The ATOMIC_FETCH_OP_AND and ATOMIC64_FETCH_OP_AND macros accept 'mb' and
> 'cl' parameters but never use them in their implementation. These macros
> simply delegate to the corresponding andnot functions, which handle the
> actual atomic operations and memory barriers.
>
> Signed-off-by: Seongsu Park <sgsu.park@samsung.com>
FWIW, this was a leftover from commit:
5e9e43c987b2 ("arm64: atomics: lse: define ANDs in terms of ANDNOTs")
... where I missed the leftover macro arguments.
AFAICT there aren't any other leftover macro arguments from that round
of asm improvments (or otherwise), so:
Acked-by: Mark Rutland <mark.rutland@arm.com>
Mark.
> ---
> arch/arm64/include/asm/atomic_lse.h | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm64/include/asm/atomic_lse.h b/arch/arm64/include/asm/atomic_lse.h
> index 87f568a94e55..afad1849c4cf 100644
> --- a/arch/arm64/include/asm/atomic_lse.h
> +++ b/arch/arm64/include/asm/atomic_lse.h
> @@ -103,17 +103,17 @@ static __always_inline void __lse_atomic_and(int i, atomic_t *v)
> return __lse_atomic_andnot(~i, v);
> }
>
> -#define ATOMIC_FETCH_OP_AND(name, mb, cl...) \
> +#define ATOMIC_FETCH_OP_AND(name) \
> static __always_inline int \
> __lse_atomic_fetch_and##name(int i, atomic_t *v) \
> { \
> return __lse_atomic_fetch_andnot##name(~i, v); \
> }
>
> -ATOMIC_FETCH_OP_AND(_relaxed, )
> -ATOMIC_FETCH_OP_AND(_acquire, a, "memory")
> -ATOMIC_FETCH_OP_AND(_release, l, "memory")
> -ATOMIC_FETCH_OP_AND( , al, "memory")
> +ATOMIC_FETCH_OP_AND(_relaxed)
> +ATOMIC_FETCH_OP_AND(_acquire)
> +ATOMIC_FETCH_OP_AND(_release)
> +ATOMIC_FETCH_OP_AND( )
>
> #undef ATOMIC_FETCH_OP_AND
>
> @@ -210,17 +210,17 @@ static __always_inline void __lse_atomic64_and(s64 i, atomic64_t *v)
> return __lse_atomic64_andnot(~i, v);
> }
>
> -#define ATOMIC64_FETCH_OP_AND(name, mb, cl...) \
> +#define ATOMIC64_FETCH_OP_AND(name) \
> static __always_inline long \
> __lse_atomic64_fetch_and##name(s64 i, atomic64_t *v) \
> { \
> return __lse_atomic64_fetch_andnot##name(~i, v); \
> }
>
> -ATOMIC64_FETCH_OP_AND(_relaxed, )
> -ATOMIC64_FETCH_OP_AND(_acquire, a, "memory")
> -ATOMIC64_FETCH_OP_AND(_release, l, "memory")
> -ATOMIC64_FETCH_OP_AND( , al, "memory")
> +ATOMIC64_FETCH_OP_AND(_relaxed)
> +ATOMIC64_FETCH_OP_AND(_acquire)
> +ATOMIC64_FETCH_OP_AND(_release)
> +ATOMIC64_FETCH_OP_AND( )
>
> #undef ATOMIC64_FETCH_OP_AND
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] arm64: atomics: lse: Remove unused parameters from ATOMIC_FETCH_OP_AND macros
2025-11-26 2:10 ` [PATCH] arm64: atomics: lse: Remove unused parameters from ATOMIC_FETCH_OP_AND macros Seongsu Park
2025-11-26 9:36 ` Mark Rutland
@ 2025-11-27 19:15 ` Catalin Marinas
1 sibling, 0 replies; 3+ messages in thread
From: Catalin Marinas @ 2025-11-27 19:15 UTC (permalink / raw)
To: will, peterz, boqun.feng, mark.rutland, gary, Seongsu Park
Cc: linux-kernel, linux-arm-kernel
On Wed, 26 Nov 2025 11:10:25 +0900, Seongsu Park wrote:
> The ATOMIC_FETCH_OP_AND and ATOMIC64_FETCH_OP_AND macros accept 'mb' and
> 'cl' parameters but never use them in their implementation. These macros
> simply delegate to the corresponding andnot functions, which handle the
> actual atomic operations and memory barriers.
>
>
Applied to arm64 (for-next/misc), thanks!
[1/1] arm64: atomics: lse: Remove unused parameters from ATOMIC_FETCH_OP_AND macros
https://git.kernel.org/arm64/c/c86d9f8764ba
--
Catalin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-27 19:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20251126021037epcas1p2c5caf948ede87748ee1d4ef536a62126@epcas1p2.samsung.com>
2025-11-26 2:10 ` [PATCH] arm64: atomics: lse: Remove unused parameters from ATOMIC_FETCH_OP_AND macros Seongsu Park
2025-11-26 9:36 ` Mark Rutland
2025-11-27 19:15 ` Catalin Marinas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).