Skip to content

Commit

Permalink
locking/atomic: scripts: fix ${atomic}_sub_and_test() kerneldoc
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/2074091

commit f92a59f upstream.

For ${atomic}_sub_and_test() the @i parameter is the value to subtract,
not add. Fix the typo in the kerneldoc template and generate the headers
with this update.

Fixes: ad81107 ("locking/atomic: scripts: generate kerneldoc comments")
Suggested-by: Mark Rutland <[email protected]>
Signed-off-by: Carlos Llamas <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Acked-by: Mark Rutland <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
[portia: updated sha1sum on atomic headers]
Signed-off-by: Portia Stephens <[email protected]>
Signed-off-by: Roxana Nicolescu <[email protected]>
  • Loading branch information
Carlos Llamas authored and roxanan1996 committed Aug 13, 2024
1 parent de23f0f commit 511d13f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions include/linux/atomic/atomic-arch-fallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -2234,7 +2234,7 @@ raw_atomic_try_cmpxchg_relaxed(atomic_t *v, int *old, int new)

/**
* raw_atomic_sub_and_test() - atomic subtract and test if zero with full ordering
* @i: int value to add
* @i: int value to subtract
* @v: pointer to atomic_t
*
* Atomically updates @v to (@v - @i) with full ordering.
Expand Down Expand Up @@ -4346,7 +4346,7 @@ raw_atomic64_try_cmpxchg_relaxed(atomic64_t *v, s64 *old, s64 new)

/**
* raw_atomic64_sub_and_test() - atomic subtract and test if zero with full ordering
* @i: s64 value to add
* @i: s64 value to subtract
* @v: pointer to atomic64_t
*
* Atomically updates @v to (@v - @i) with full ordering.
Expand Down Expand Up @@ -4662,4 +4662,4 @@ raw_atomic64_dec_if_positive(atomic64_t *v)
}

#endif /* _LINUX_ATOMIC_FALLBACK_H */
// eec048affea735b8464f58e6d96992101f8f85f1
// 192d6476c0a1486196d1a01386828be566343816
8 changes: 4 additions & 4 deletions include/linux/atomic/atomic-instrumented.h
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@ atomic_try_cmpxchg_relaxed(atomic_t *v, int *old, int new)

/**
* atomic_sub_and_test() - atomic subtract and test if zero with full ordering
* @i: int value to add
* @i: int value to subtract
* @v: pointer to atomic_t
*
* Atomically updates @v to (@v - @i) with full ordering.
Expand Down Expand Up @@ -2905,7 +2905,7 @@ atomic64_try_cmpxchg_relaxed(atomic64_t *v, s64 *old, s64 new)

/**
* atomic64_sub_and_test() - atomic subtract and test if zero with full ordering
* @i: s64 value to add
* @i: s64 value to subtract
* @v: pointer to atomic64_t
*
* Atomically updates @v to (@v - @i) with full ordering.
Expand Down Expand Up @@ -4469,7 +4469,7 @@ atomic_long_try_cmpxchg_relaxed(atomic_long_t *v, long *old, long new)

/**
* atomic_long_sub_and_test() - atomic subtract and test if zero with full ordering
* @i: long value to add
* @i: long value to subtract
* @v: pointer to atomic_long_t
*
* Atomically updates @v to (@v - @i) with full ordering.
Expand Down Expand Up @@ -5008,4 +5008,4 @@ atomic_long_dec_if_positive(atomic_long_t *v)


#endif /* _LINUX_ATOMIC_INSTRUMENTED_H */
// 2cc4bc990fef44d3836ec108f11b610f3f438184
// 1b2571b4e17a6671a7631db8158e0fa5afb6e51d
4 changes: 2 additions & 2 deletions include/linux/atomic/atomic-long.h
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,7 @@ raw_atomic_long_try_cmpxchg_relaxed(atomic_long_t *v, long *old, long new)

/**
* raw_atomic_long_sub_and_test() - atomic subtract and test if zero with full ordering
* @i: long value to add
* @i: long value to subtract
* @v: pointer to atomic_long_t
*
* Atomically updates @v to (@v - @i) with full ordering.
Expand Down Expand Up @@ -1795,4 +1795,4 @@ raw_atomic_long_dec_if_positive(atomic_long_t *v)
}

#endif /* _LINUX_ATOMIC_LONG_H */
// 4ef23f98c73cff96d239896175fd26b10b88899e
// f8204cfa718c04a01e3c7a15257ac85bbef54c23
2 changes: 1 addition & 1 deletion scripts/atomic/kerneldoc/sub_and_test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cat <<EOF
/**
* ${class}${atomicname}() - atomic subtract and test if zero with ${desc_order} ordering
* @i: ${int} value to add
* @i: ${int} value to subtract
* @v: pointer to ${atomic}_t
*
* Atomically updates @v to (@v - @i) with ${desc_order} ordering.
Expand Down

0 comments on commit 511d13f

Please sign in to comment.