diff options
author | Paul E. McKenney <paulmck@kernel.org> | 2023-05-02 16:29:40 -0700 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2023-05-10 10:45:34 -0700 |
commit | 1fed5374d367ea026c8d5623458098a8c5dd4dc2 (patch) | |
tree | 04276cefe9699662b65cf48413dabd3f98b56c9c /scripts | |
parent | 19549d880858c71d57862d590e88c6ccd8476dd1 (diff) | |
download | linux-next-1fed5374d367ea026c8d5623458098a8c5dd4dc2.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-x | scripts/atomic/fallbacks/dec_if_positive | 10 |
1 files changed, 10 insertions, 0 deletions
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) { |