summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2023-05-02 16:29:40 -0700
committerPaul E. McKenney <paulmck@kernel.org>2023-05-11 15:13:17 -0700
commit29d95e74aeb094bf7e2a0508deea99b38b7c198e (patch)
tree54348ea0f7b819df061d7fcf5c1744e0f876e52c /scripts
parent128101fa44d5e05324d44e4656497d3d01eace48 (diff)
downloadlinux-next-29d95e74aeb094bf7e2a0508deea99b38b7c198e.tar.gz
locking/atomic: Add kernel-doc header for arch_${atomic}_dec_if_positive
Add kernel-doc header template for arch_${atomic}_dec_if_positive function family. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Cc: Will Deacon <will@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Mark Rutland <mark.rutland@arm.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/atomic/fallbacks/dec_if_positive11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/atomic/fallbacks/dec_if_positive b/scripts/atomic/fallbacks/dec_if_positive
index 86bdced3428d..b3858a780e21 100755
--- a/scripts/atomic/fallbacks/dec_if_positive
+++ b/scripts/atomic/fallbacks/dec_if_positive
@@ -1,4 +1,15 @@
cat <<EOF
+/**
+ * arch_${atomic}_dec_if_positive - Atomic decrement if old value is positive
+ * @v: pointer of type ${atomic}_t
+ *
+ * Atomically decrement @v with full ordering, but only if the original
+ * value is greater than zero, returning new value. Note that the desired
+ * new value will be returned even if the decrement did not occur, so that
+ * if the old value is -3, then there @v will not be decremented, but -4
+ * will be returned. As a result, if the return value is non-negative,
+ * then the value was in fact decremented.
+ */
static __always_inline ${ret}
arch_${atomic}_dec_if_positive(${atomic}_t *v)
{