[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230510181717.2200934-9-paulmck@kernel.org>
Date: Wed, 10 May 2023 11:17:07 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: x86@...nel.org, akiyks@...il.com, linux-doc@...r.kernel.org,
kernel-team@...a.com, "Paul E. McKenney" <paulmck@...nel.org>,
Will Deacon <will@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Boqun Feng <boqun.feng@...il.com>,
Mark Rutland <mark.rutland@....com>
Subject: [PATCH locking/atomic 09/19] locking/atomic: Add kernel-doc header for arch_${atomic}_dec_unless_positive
Add kernel-doc header template for arch_${atomic}_dec_unless_positive
function family.
Signed-off-by: Paul E. McKenney <paulmck@...nel.org>
Cc: Will Deacon <will@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Boqun Feng <boqun.feng@...il.com>
Cc: Mark Rutland <mark.rutland@....com>
---
include/linux/atomic/atomic-arch-fallback.h | 18 +++++++++++++++++-
scripts/atomic/fallbacks/dec_unless_positive | 8 ++++++++
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h
index 4d4d94925cb0..e6c7356d5dfc 100644
--- a/include/linux/atomic/atomic-arch-fallback.h
+++ b/include/linux/atomic/atomic-arch-fallback.h
@@ -1625,6 +1625,14 @@ arch_atomic_inc_unless_negative(atomic_t *v)
#endif
#ifndef arch_atomic_dec_unless_positive
+/**
+ * arch_atomic_dec_unless_positive - Atomic decrement if old value is non-positive
+ * @v: pointer of type atomic_t
+ *
+ * Atomically decrement @v, but only if the original value is less
+ * than or equal to zero. Return @true if the decrement happened and
+ * @false otherwise.
+ */
static __always_inline bool
arch_atomic_dec_unless_positive(atomic_t *v)
{
@@ -3057,6 +3065,14 @@ arch_atomic64_inc_unless_negative(atomic64_t *v)
#endif
#ifndef arch_atomic64_dec_unless_positive
+/**
+ * arch_atomic64_dec_unless_positive - Atomic decrement if old value is non-positive
+ * @v: pointer of type atomic64_t
+ *
+ * Atomically decrement @v, but only if the original value is less
+ * than or equal to zero. Return @true if the decrement happened and
+ * @false otherwise.
+ */
static __always_inline bool
arch_atomic64_dec_unless_positive(atomic64_t *v)
{
@@ -3100,4 +3116,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v)
#endif
#endif /* _LINUX_ATOMIC_FALLBACK_H */
-// c7041896e7e66a52d8005ba021f3b3b05f99bcb3
+// 225b2fe3eb6bbe34729abed7a856b91abc8d434e
diff --git a/scripts/atomic/fallbacks/dec_unless_positive b/scripts/atomic/fallbacks/dec_unless_positive
index c531d5afecc4..c3d01d201c63 100755
--- a/scripts/atomic/fallbacks/dec_unless_positive
+++ b/scripts/atomic/fallbacks/dec_unless_positive
@@ -1,4 +1,12 @@
cat <<EOF
+/**
+ * arch_${atomic}_dec_unless_positive - Atomic decrement if old value is non-positive
+ * @v: pointer of type ${atomic}_t
+ *
+ * Atomically decrement @v, but only if the original value is less
+ * than or equal to zero. Return @true if the decrement happened and
+ * @false otherwise.
+ */
static __always_inline bool
arch_${atomic}_dec_unless_positive(${atomic}_t *v)
{
--
2.40.1
Powered by blists - more mailing lists