Add kernel-doc header template for arch_${atomic}_dec_unless_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 | 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