[PATCH locking/atomic 08/19] locking/atomic: Add kernel-doc header for arch_${atomic}_dec_if_positive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add kernel-doc header template for arch_${atomic}_dec_if_positive
function family.

Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
Cc: Will Deacon <will@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Boqun Feng <boqun.feng@xxxxxxxxx>
Cc: Mark Rutland <mark.rutland@xxxxxxx>
---
 include/linux/atomic/atomic-arch-fallback.h | 22 ++++++++++++++++++++-
 scripts/atomic/fallbacks/dec_if_positive    | 10 ++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h
index ed72d94346e9..4d4d94925cb0 100644
--- a/include/linux/atomic/atomic-arch-fallback.h
+++ b/include/linux/atomic/atomic-arch-fallback.h
@@ -1641,6 +1641,16 @@ arch_atomic_dec_unless_positive(atomic_t *v)
 #endif
 
 #ifndef arch_atomic_dec_if_positive
+/**
+ * arch_atomic_dec_if_positive - Atomic decrement if old value is positive
+ * @v: pointer of type atomic_t
+ *
+ * Atomically decrement @v, 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 int
 arch_atomic_dec_if_positive(atomic_t *v)
 {
@@ -3063,6 +3073,16 @@ arch_atomic64_dec_unless_positive(atomic64_t *v)
 #endif
 
 #ifndef arch_atomic64_dec_if_positive
+/**
+ * arch_atomic64_dec_if_positive - Atomic decrement if old value is positive
+ * @v: pointer of type atomic64_t
+ *
+ * Atomically decrement @v, 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 s64
 arch_atomic64_dec_if_positive(atomic64_t *v)
 {
@@ -3080,4 +3100,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v)
 #endif
 
 #endif /* _LINUX_ATOMIC_FALLBACK_H */
-// 3b29d5595f48f921507f19bc794c91aecb782ad3
+// c7041896e7e66a52d8005ba021f3b3b05f99bcb3
diff --git a/scripts/atomic/fallbacks/dec_if_positive b/scripts/atomic/fallbacks/dec_if_positive
index 86bdced3428d..dedbdbc1487d 100755
--- a/scripts/atomic/fallbacks/dec_if_positive
+++ b/scripts/atomic/fallbacks/dec_if_positive
@@ -1,4 +1,14 @@
 cat <<EOF
+/**
+ * arch_${atomic}_dec_if_positive - Atomic decrement if old value is positive
+ * @v: pointer of type ${atomic}_t
+ *
+ * Atomically decrement @v, 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)
 {
-- 
2.40.1




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux