Add kernel-doc header template for arch_${atomic}_inc_unless_negative 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/inc_unless_negative | 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 e6c7356d5dfc..a90ee496bb81 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -1609,6 +1609,14 @@ arch_atomic_inc_not_zero(atomic_t *v) #endif #ifndef arch_atomic_inc_unless_negative +/** + * arch_atomic_inc_unless_negative - Atomic increment if old value is non-negative + * @v: pointer of type atomic_t + * + * Atomically increment @v, but only if the original value is greater + * than or equal to zero. Return @true if the increment happened and + * @false otherwise. + */ static __always_inline bool arch_atomic_inc_unless_negative(atomic_t *v) { @@ -3049,6 +3057,14 @@ arch_atomic64_inc_not_zero(atomic64_t *v) #endif #ifndef arch_atomic64_inc_unless_negative +/** + * arch_atomic64_inc_unless_negative - Atomic increment if old value is non-negative + * @v: pointer of type atomic64_t + * + * Atomically increment @v, but only if the original value is greater + * than or equal to zero. Return @true if the increment happened and + * @false otherwise. + */ static __always_inline bool arch_atomic64_inc_unless_negative(atomic64_t *v) { @@ -3116,4 +3132,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) #endif #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// 225b2fe3eb6bbe34729abed7a856b91abc8d434e +// 3fd0ec685588b84c6428145b7628f79ce23a464c diff --git a/scripts/atomic/fallbacks/inc_unless_negative b/scripts/atomic/fallbacks/inc_unless_negative index 95d8ce48233f..98830b0dcdb1 100755 --- a/scripts/atomic/fallbacks/inc_unless_negative +++ b/scripts/atomic/fallbacks/inc_unless_negative @@ -1,4 +1,12 @@ cat <<EOF +/** + * arch_${atomic}_inc_unless_negative - Atomic increment if old value is non-negative + * @v: pointer of type ${atomic}_t + * + * Atomically increment @v, but only if the original value is greater + * than or equal to zero. Return @true if the increment happened and + * @false otherwise. + */ static __always_inline bool arch_${atomic}_inc_unless_negative(${atomic}_t *v) { -- 2.40.1