public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] locking/atomic: fix trivial typo in comment
@ 2024-05-14 22:46 Carlos Llamas
  2024-05-14 22:48 ` Kees Cook
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Carlos Llamas @ 2024-05-14 22:46 UTC (permalink / raw)
  To: Mark Rutland, Peter Zijlstra, Kees Cook, Paul E. McKenney,
	Ingo Molnar, Carlos Llamas, Uros Bizjak
  Cc: linux-kernel, kernel-team, stable, Arnd Bergmann

For atomic_sub_and_test() the @i parameter is the value to subtract, not
add. Fix the kerneldoc comment accordingly.

Fixes: ad8110706f38 ("locking/atomic: scripts: generate kerneldoc comments")
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Carlos Llamas <cmllamas@google.com>
---
 include/linux/atomic/atomic-instrumented.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/atomic/atomic-instrumented.h b/include/linux/atomic/atomic-instrumented.h
index debd487fe971..12b558c05384 100644
--- a/include/linux/atomic/atomic-instrumented.h
+++ b/include/linux/atomic/atomic-instrumented.h
@@ -1349,7 +1349,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.
-- 
2.45.0.rc1.225.g2a3ae87e7f-goog


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] locking/atomic: fix trivial typo in comment
  2024-05-14 22:46 [PATCH] locking/atomic: fix trivial typo in comment Carlos Llamas
@ 2024-05-14 22:48 ` Kees Cook
  2024-05-15  5:04 ` kernel test robot
  2024-05-15  8:11 ` Mark Rutland
  2 siblings, 0 replies; 11+ messages in thread
From: Kees Cook @ 2024-05-14 22:48 UTC (permalink / raw)
  To: Carlos Llamas
  Cc: Mark Rutland, Peter Zijlstra, Paul E. McKenney, Ingo Molnar,
	Uros Bizjak, linux-kernel, kernel-team, stable, Arnd Bergmann

On Tue, May 14, 2024 at 10:46:03PM +0000, Carlos Llamas wrote:
> For atomic_sub_and_test() the @i parameter is the value to subtract, not
> add. Fix the kerneldoc comment accordingly.
> 
> Fixes: ad8110706f38 ("locking/atomic: scripts: generate kerneldoc comments")
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Carlos Llamas <cmllamas@google.com>

Thanks!

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] locking/atomic: fix trivial typo in comment
  2024-05-14 22:46 [PATCH] locking/atomic: fix trivial typo in comment Carlos Llamas
  2024-05-14 22:48 ` Kees Cook
@ 2024-05-15  5:04 ` kernel test robot
  2024-05-15  8:11 ` Mark Rutland
  2 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2024-05-15  5:04 UTC (permalink / raw)
  To: Carlos Llamas, Mark Rutland, Peter Zijlstra, Kees Cook,
	Paul E. McKenney, Ingo Molnar, Uros Bizjak
  Cc: oe-kbuild-all, linux-kernel, kernel-team, stable, Arnd Bergmann

Hi Carlos,

kernel test robot noticed the following build errors:

[auto build test ERROR on kees/for-next/pstore]
[also build test ERROR on kees/for-next/kspp linus/master v6.9 next-20240514]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Carlos-Llamas/locking-atomic-fix-trivial-typo-in-comment/20240515-064934
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/pstore
patch link:    https://lore.kernel.org/r/20240514224625.3280818-1-cmllamas%40google.com
patch subject: [PATCH] locking/atomic: fix trivial typo in comment
config: openrisc-defconfig (https://download.01.org/0day-ci/archive/20240515/202405151209.U1zWe95G-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240515/202405151209.U1zWe95G-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405151209.U1zWe95G-lkp@intel.com/

All errors (new ones prefixed by >>):

>> error: include/linux/atomic/atomic-instrumented.h has been modified.
   make[3]: *** [./Kbuild:68: .checked-atomic-instrumented.h] Error 1
   make[3]: Target 'prepare' not remade because of errors.
   make[2]: *** [Makefile:1197: prepare0] Error 2
   make[2]: Target 'prepare' not remade because of errors.
   make[1]: *** [Makefile:240: __sub-make] Error 2
   make[1]: Target 'prepare' not remade because of errors.
   make: *** [Makefile:240: __sub-make] Error 2
   make: Target 'prepare' not remade because of errors.

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] locking/atomic: fix trivial typo in comment
  2024-05-14 22:46 [PATCH] locking/atomic: fix trivial typo in comment Carlos Llamas
  2024-05-14 22:48 ` Kees Cook
  2024-05-15  5:04 ` kernel test robot
@ 2024-05-15  8:11 ` Mark Rutland
  2024-05-15 13:16   ` Carlos Llamas
  2024-05-15 13:37   ` [PATCH v2] locking/atomic: scripts: fix ${atomic}_sub_and_test() kerneldoc Carlos Llamas
  2 siblings, 2 replies; 11+ messages in thread
From: Mark Rutland @ 2024-05-15  8:11 UTC (permalink / raw)
  To: Carlos Llamas
  Cc: Peter Zijlstra, Kees Cook, Paul E. McKenney, Ingo Molnar,
	Uros Bizjak, linux-kernel, kernel-team, stable, Arnd Bergmann

Hi Carlos,

On Tue, May 14, 2024 at 10:46:03PM +0000, Carlos Llamas wrote:
> For atomic_sub_and_test() the @i parameter is the value to subtract, not
> add. Fix the kerneldoc comment accordingly.
> 
> Fixes: ad8110706f38 ("locking/atomic: scripts: generate kerneldoc comments")
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Carlos Llamas <cmllamas@google.com>
> ---
>  include/linux/atomic/atomic-instrumented.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/atomic/atomic-instrumented.h b/include/linux/atomic/atomic-instrumented.h
> index debd487fe971..12b558c05384 100644
> --- a/include/linux/atomic/atomic-instrumented.h
> +++ b/include/linux/atomic/atomic-instrumented.h
> @@ -1349,7 +1349,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

Whoops; sorry about that.

The atomic headers are generated, and this kerneldoc comment is
generated from the template in scripts/atomic/kerneldoc/sub_and_test

You'll need to modify that then run:

  sh scripts/atomic/gen-atomics.sh

... to regenerate all the affected instances of ${atomic}_sub_and_test()

Thanks,
Mark.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] locking/atomic: fix trivial typo in comment
  2024-05-15  8:11 ` Mark Rutland
@ 2024-05-15 13:16   ` Carlos Llamas
  2024-05-15 13:37   ` [PATCH v2] locking/atomic: scripts: fix ${atomic}_sub_and_test() kerneldoc Carlos Llamas
  1 sibling, 0 replies; 11+ messages in thread
From: Carlos Llamas @ 2024-05-15 13:16 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Peter Zijlstra, Kees Cook, Paul E. McKenney, Ingo Molnar,
	Uros Bizjak, linux-kernel, kernel-team, stable, Arnd Bergmann

On Wed, May 15, 2024 at 10:11:29AM +0200, Mark Rutland wrote:
> Hi Carlos,
> 
> On Tue, May 14, 2024 at 10:46:03PM +0000, Carlos Llamas wrote:
> > For atomic_sub_and_test() the @i parameter is the value to subtract, not
> > add. Fix the kerneldoc comment accordingly.
> > 
> > Fixes: ad8110706f38 ("locking/atomic: scripts: generate kerneldoc comments")
> > Cc: Mark Rutland <mark.rutland@arm.com>
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Carlos Llamas <cmllamas@google.com>
> > ---
> >  include/linux/atomic/atomic-instrumented.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/include/linux/atomic/atomic-instrumented.h b/include/linux/atomic/atomic-instrumented.h
> > index debd487fe971..12b558c05384 100644
> > --- a/include/linux/atomic/atomic-instrumented.h
> > +++ b/include/linux/atomic/atomic-instrumented.h
> > @@ -1349,7 +1349,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
> 
> Whoops; sorry about that.
> 
> The atomic headers are generated, and this kerneldoc comment is
> generated from the template in scripts/atomic/kerneldoc/sub_and_test

Oh I see. Sorry, I wasn't aware of this.

> 
> You'll need to modify that then run:
> 
>   sh scripts/atomic/gen-atomics.sh
> 
> ... to regenerate all the affected instances of ${atomic}_sub_and_test()

Ok, let me go do that. Thanks!

> 
> Thanks,
> Mark.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2] locking/atomic: scripts: fix ${atomic}_sub_and_test() kerneldoc
  2024-05-15  8:11 ` Mark Rutland
  2024-05-15 13:16   ` Carlos Llamas
@ 2024-05-15 13:37   ` Carlos Llamas
  2024-05-16  8:45     ` Mark Rutland
  2024-06-05 14:04     ` [tip: locking/urgent] " tip-bot2 for Carlos Llamas
  1 sibling, 2 replies; 11+ messages in thread
From: Carlos Llamas @ 2024-05-15 13:37 UTC (permalink / raw)
  To: Will Deacon, Peter Zijlstra, Boqun Feng, Mark Rutland, Kees Cook,
	Ingo Molnar, Paul E. McKenney, Carlos Llamas, Uros Bizjak,
	Nhat Pham
  Cc: linux-kernel, kernel-team, stable, Arnd Bergmann

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: ad8110706f38 ("locking/atomic: scripts: generate kerneldoc comments")
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: stable@vger.kernel.org
Suggested-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
---

Notes:
    v2: fix kerneldoc template instead, as pointed out by Mark

 include/linux/atomic/atomic-arch-fallback.h | 6 +++---
 include/linux/atomic/atomic-instrumented.h  | 8 ++++----
 include/linux/atomic/atomic-long.h          | 4 ++--
 scripts/atomic/kerneldoc/sub_and_test       | 2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h
index 956bcba5dbf2..2f9d36b72bd8 100644
--- a/include/linux/atomic/atomic-arch-fallback.h
+++ b/include/linux/atomic/atomic-arch-fallback.h
@@ -2242,7 +2242,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.
@@ -4368,7 +4368,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.
@@ -4690,4 +4690,4 @@ raw_atomic64_dec_if_positive(atomic64_t *v)
 }
 
 #endif /* _LINUX_ATOMIC_FALLBACK_H */
-// 14850c0b0db20c62fdc78ccd1d42b98b88d76331
+// b565db590afeeff0d7c9485ccbca5bb6e155749f
diff --git a/include/linux/atomic/atomic-instrumented.h b/include/linux/atomic/atomic-instrumented.h
index debd487fe971..9409a6ddf3e0 100644
--- a/include/linux/atomic/atomic-instrumented.h
+++ b/include/linux/atomic/atomic-instrumented.h
@@ -1349,7 +1349,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.
@@ -2927,7 +2927,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.
@@ -4505,7 +4505,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.
@@ -5050,4 +5050,4 @@ atomic_long_dec_if_positive(atomic_long_t *v)
 
 
 #endif /* _LINUX_ATOMIC_INSTRUMENTED_H */
-// ce5b65e0f1f8a276268b667194581d24bed219d4
+// 8829b337928e9508259079d32581775ececd415b
diff --git a/include/linux/atomic/atomic-long.h b/include/linux/atomic/atomic-long.h
index 3ef844b3ab8a..f86b29d90877 100644
--- a/include/linux/atomic/atomic-long.h
+++ b/include/linux/atomic/atomic-long.h
@@ -1535,7 +1535,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.
@@ -1809,4 +1809,4 @@ raw_atomic_long_dec_if_positive(atomic_long_t *v)
 }
 
 #endif /* _LINUX_ATOMIC_LONG_H */
-// 1c4a26fc77f345342953770ebe3c4d08e7ce2f9a
+// eadf183c3600b8b92b91839dd3be6bcc560c752d
diff --git a/scripts/atomic/kerneldoc/sub_and_test b/scripts/atomic/kerneldoc/sub_and_test
index d3760f7749d4..96615e50836b 100644
--- a/scripts/atomic/kerneldoc/sub_and_test
+++ b/scripts/atomic/kerneldoc/sub_and_test
@@ -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.
-- 
2.45.0.rc1.225.g2a3ae87e7f-goog


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] locking/atomic: scripts: fix ${atomic}_sub_and_test() kerneldoc
  2024-05-15 13:37   ` [PATCH v2] locking/atomic: scripts: fix ${atomic}_sub_and_test() kerneldoc Carlos Llamas
@ 2024-05-16  8:45     ` Mark Rutland
  2024-05-16  8:53       ` Peter Zijlstra
  2024-06-05 14:04     ` [tip: locking/urgent] " tip-bot2 for Carlos Llamas
  1 sibling, 1 reply; 11+ messages in thread
From: Mark Rutland @ 2024-05-16  8:45 UTC (permalink / raw)
  To: Carlos Llamas, Peter Zijlstra, Ingo Molnar
  Cc: Will Deacon, Boqun Feng, Kees Cook, Paul E. McKenney, Uros Bizjak,
	Nhat Pham, linux-kernel, kernel-team, stable, Arnd Bergmann

On Wed, May 15, 2024 at 01:37:10PM +0000, Carlos Llamas wrote:
> 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: ad8110706f38 ("locking/atomic: scripts: generate kerneldoc comments")
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: stable@vger.kernel.org
> Suggested-by: Mark Rutland <mark.rutland@arm.com>
> Reviewed-by: Kees Cook <keescook@chromium.org>
> Signed-off-by: Carlos Llamas <cmllamas@google.com>
> ---
> 
> Notes:
>     v2: fix kerneldoc template instead, as pointed out by Mark

Thanks for this!

Acked-by: Mark Rutland <mark.rutland@arm.com>

Peter, Ingo, are you happy to queue this up in the tip tree?

Thanks,
Mark.

> 
>  include/linux/atomic/atomic-arch-fallback.h | 6 +++---
>  include/linux/atomic/atomic-instrumented.h  | 8 ++++----
>  include/linux/atomic/atomic-long.h          | 4 ++--
>  scripts/atomic/kerneldoc/sub_and_test       | 2 +-
>  4 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h
> index 956bcba5dbf2..2f9d36b72bd8 100644
> --- a/include/linux/atomic/atomic-arch-fallback.h
> +++ b/include/linux/atomic/atomic-arch-fallback.h
> @@ -2242,7 +2242,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.
> @@ -4368,7 +4368,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.
> @@ -4690,4 +4690,4 @@ raw_atomic64_dec_if_positive(atomic64_t *v)
>  }
>  
>  #endif /* _LINUX_ATOMIC_FALLBACK_H */
> -// 14850c0b0db20c62fdc78ccd1d42b98b88d76331
> +// b565db590afeeff0d7c9485ccbca5bb6e155749f
> diff --git a/include/linux/atomic/atomic-instrumented.h b/include/linux/atomic/atomic-instrumented.h
> index debd487fe971..9409a6ddf3e0 100644
> --- a/include/linux/atomic/atomic-instrumented.h
> +++ b/include/linux/atomic/atomic-instrumented.h
> @@ -1349,7 +1349,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.
> @@ -2927,7 +2927,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.
> @@ -4505,7 +4505,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.
> @@ -5050,4 +5050,4 @@ atomic_long_dec_if_positive(atomic_long_t *v)
>  
>  
>  #endif /* _LINUX_ATOMIC_INSTRUMENTED_H */
> -// ce5b65e0f1f8a276268b667194581d24bed219d4
> +// 8829b337928e9508259079d32581775ececd415b
> diff --git a/include/linux/atomic/atomic-long.h b/include/linux/atomic/atomic-long.h
> index 3ef844b3ab8a..f86b29d90877 100644
> --- a/include/linux/atomic/atomic-long.h
> +++ b/include/linux/atomic/atomic-long.h
> @@ -1535,7 +1535,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.
> @@ -1809,4 +1809,4 @@ raw_atomic_long_dec_if_positive(atomic_long_t *v)
>  }
>  
>  #endif /* _LINUX_ATOMIC_LONG_H */
> -// 1c4a26fc77f345342953770ebe3c4d08e7ce2f9a
> +// eadf183c3600b8b92b91839dd3be6bcc560c752d
> diff --git a/scripts/atomic/kerneldoc/sub_and_test b/scripts/atomic/kerneldoc/sub_and_test
> index d3760f7749d4..96615e50836b 100644
> --- a/scripts/atomic/kerneldoc/sub_and_test
> +++ b/scripts/atomic/kerneldoc/sub_and_test
> @@ -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.
> -- 
> 2.45.0.rc1.225.g2a3ae87e7f-goog
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] locking/atomic: scripts: fix ${atomic}_sub_and_test() kerneldoc
  2024-05-16  8:45     ` Mark Rutland
@ 2024-05-16  8:53       ` Peter Zijlstra
  2024-05-16  9:49         ` Peter Zijlstra
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Zijlstra @ 2024-05-16  8:53 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Carlos Llamas, Ingo Molnar, Will Deacon, Boqun Feng, Kees Cook,
	Paul E. McKenney, Uros Bizjak, Nhat Pham, linux-kernel,
	kernel-team, stable, Arnd Bergmann

On Thu, May 16, 2024 at 10:45:58AM +0200, Mark Rutland wrote:
> On Wed, May 15, 2024 at 01:37:10PM +0000, Carlos Llamas wrote:
> > 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: ad8110706f38 ("locking/atomic: scripts: generate kerneldoc comments")
> > Cc: Mark Rutland <mark.rutland@arm.com>
> > Cc: stable@vger.kernel.org
> > Suggested-by: Mark Rutland <mark.rutland@arm.com>
> > Reviewed-by: Kees Cook <keescook@chromium.org>
> > Signed-off-by: Carlos Llamas <cmllamas@google.com>
> > ---
> > 
> > Notes:
> >     v2: fix kerneldoc template instead, as pointed out by Mark
> 
> Thanks for this!
> 
> Acked-by: Mark Rutland <mark.rutland@arm.com>
> 
> Peter, Ingo, are you happy to queue this up in the tip tree?

Yep can do. I'll sit on it until after the merge window though.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] locking/atomic: scripts: fix ${atomic}_sub_and_test() kerneldoc
  2024-05-16  8:53       ` Peter Zijlstra
@ 2024-05-16  9:49         ` Peter Zijlstra
  2024-05-16 10:02           ` Mark Rutland
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Zijlstra @ 2024-05-16  9:49 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Carlos Llamas, Ingo Molnar, Will Deacon, Boqun Feng, Kees Cook,
	Paul E. McKenney, Uros Bizjak, Nhat Pham, linux-kernel,
	kernel-team, stable, Arnd Bergmann, Greg Kroah-Hartman

On Thu, May 16, 2024 at 10:53:10AM +0200, Peter Zijlstra wrote:
> On Thu, May 16, 2024 at 10:45:58AM +0200, Mark Rutland wrote:
> > On Wed, May 15, 2024 at 01:37:10PM +0000, Carlos Llamas wrote:
> > > 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: ad8110706f38 ("locking/atomic: scripts: generate kerneldoc comments")
> > > Cc: Mark Rutland <mark.rutland@arm.com>
> > > Cc: stable@vger.kernel.org
> > > Suggested-by: Mark Rutland <mark.rutland@arm.com>
> > > Reviewed-by: Kees Cook <keescook@chromium.org>
> > > Signed-off-by: Carlos Llamas <cmllamas@google.com>
> > > ---
> > > 
> > > Notes:
> > >     v2: fix kerneldoc template instead, as pointed out by Mark
> > 
> > Thanks for this!
> > 
> > Acked-by: Mark Rutland <mark.rutland@arm.com>
> > 
> > Peter, Ingo, are you happy to queue this up in the tip tree?
> 
> Yep can do. I'll sit on it until after the merge window though.

Also, do we really want this in stable? It's just a silly doc change.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] locking/atomic: scripts: fix ${atomic}_sub_and_test() kerneldoc
  2024-05-16  9:49         ` Peter Zijlstra
@ 2024-05-16 10:02           ` Mark Rutland
  0 siblings, 0 replies; 11+ messages in thread
From: Mark Rutland @ 2024-05-16 10:02 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Carlos Llamas, Ingo Molnar, Will Deacon, Boqun Feng, Kees Cook,
	Paul E. McKenney, Uros Bizjak, Nhat Pham, linux-kernel,
	kernel-team, stable, Arnd Bergmann, Greg Kroah-Hartman

On Thu, May 16, 2024 at 11:49:20AM +0200, Peter Zijlstra wrote:
> On Thu, May 16, 2024 at 10:53:10AM +0200, Peter Zijlstra wrote:
> > On Thu, May 16, 2024 at 10:45:58AM +0200, Mark Rutland wrote:
> > > On Wed, May 15, 2024 at 01:37:10PM +0000, Carlos Llamas wrote:
> > > > 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: ad8110706f38 ("locking/atomic: scripts: generate kerneldoc comments")
> > > > Cc: Mark Rutland <mark.rutland@arm.com>
> > > > Cc: stable@vger.kernel.org
> > > > Suggested-by: Mark Rutland <mark.rutland@arm.com>
> > > > Reviewed-by: Kees Cook <keescook@chromium.org>
> > > > Signed-off-by: Carlos Llamas <cmllamas@google.com>
> > > > ---
> > > > 
> > > > Notes:
> > > >     v2: fix kerneldoc template instead, as pointed out by Mark
> > > 
> > > Thanks for this!
> > > 
> > > Acked-by: Mark Rutland <mark.rutland@arm.com>
> > > 
> > > Peter, Ingo, are you happy to queue this up in the tip tree?
> > 
> > Yep can do. I'll sit on it until after the merge window though.
> 
> Also, do we really want this in stable? It's just a silly doc change.

I think that we do, so that when people look at the generated docs for
stable kernels they see the right thing.

It *should* be a trivial backport, anyhow.

Mark.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [tip: locking/urgent] locking/atomic: scripts: fix ${atomic}_sub_and_test() kerneldoc
  2024-05-15 13:37   ` [PATCH v2] locking/atomic: scripts: fix ${atomic}_sub_and_test() kerneldoc Carlos Llamas
  2024-05-16  8:45     ` Mark Rutland
@ 2024-06-05 14:04     ` tip-bot2 for Carlos Llamas
  1 sibling, 0 replies; 11+ messages in thread
From: tip-bot2 for Carlos Llamas @ 2024-06-05 14:04 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Mark Rutland, Carlos Llamas, Peter Zijlstra (Intel), Kees Cook,
	stable, x86, linux-kernel

The following commit has been merged into the locking/urgent branch of tip:

Commit-ID:     f92a59f6d12e31ead999fee9585471b95a8ae8a3
Gitweb:        https://git.kernel.org/tip/f92a59f6d12e31ead999fee9585471b95a8ae8a3
Author:        Carlos Llamas <cmllamas@google.com>
AuthorDate:    Wed, 15 May 2024 13:37:10 
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 05 Jun 2024 15:52:34 +02:00

locking/atomic: scripts: fix ${atomic}_sub_and_test() kerneldoc

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: ad8110706f38 ("locking/atomic: scripts: generate kerneldoc comments")
Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20240515133844.3502360-1-cmllamas@google.com
---
 include/linux/atomic/atomic-arch-fallback.h | 6 +++---
 include/linux/atomic/atomic-instrumented.h  | 8 ++++----
 include/linux/atomic/atomic-long.h          | 4 ++--
 scripts/atomic/kerneldoc/sub_and_test       | 2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h
index 956bcba..2f9d36b 100644
--- a/include/linux/atomic/atomic-arch-fallback.h
+++ b/include/linux/atomic/atomic-arch-fallback.h
@@ -2242,7 +2242,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.
@@ -4368,7 +4368,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.
@@ -4690,4 +4690,4 @@ raw_atomic64_dec_if_positive(atomic64_t *v)
 }
 
 #endif /* _LINUX_ATOMIC_FALLBACK_H */
-// 14850c0b0db20c62fdc78ccd1d42b98b88d76331
+// b565db590afeeff0d7c9485ccbca5bb6e155749f
diff --git a/include/linux/atomic/atomic-instrumented.h b/include/linux/atomic/atomic-instrumented.h
index debd487..9409a6d 100644
--- a/include/linux/atomic/atomic-instrumented.h
+++ b/include/linux/atomic/atomic-instrumented.h
@@ -1349,7 +1349,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.
@@ -2927,7 +2927,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.
@@ -4505,7 +4505,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.
@@ -5050,4 +5050,4 @@ atomic_long_dec_if_positive(atomic_long_t *v)
 
 
 #endif /* _LINUX_ATOMIC_INSTRUMENTED_H */
-// ce5b65e0f1f8a276268b667194581d24bed219d4
+// 8829b337928e9508259079d32581775ececd415b
diff --git a/include/linux/atomic/atomic-long.h b/include/linux/atomic/atomic-long.h
index 3ef844b..f86b29d 100644
--- a/include/linux/atomic/atomic-long.h
+++ b/include/linux/atomic/atomic-long.h
@@ -1535,7 +1535,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.
@@ -1809,4 +1809,4 @@ raw_atomic_long_dec_if_positive(atomic_long_t *v)
 }
 
 #endif /* _LINUX_ATOMIC_LONG_H */
-// 1c4a26fc77f345342953770ebe3c4d08e7ce2f9a
+// eadf183c3600b8b92b91839dd3be6bcc560c752d
diff --git a/scripts/atomic/kerneldoc/sub_and_test b/scripts/atomic/kerneldoc/sub_and_test
index d3760f7..96615e5 100644
--- a/scripts/atomic/kerneldoc/sub_and_test
+++ b/scripts/atomic/kerneldoc/sub_and_test
@@ -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.

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-06-05 14:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-14 22:46 [PATCH] locking/atomic: fix trivial typo in comment Carlos Llamas
2024-05-14 22:48 ` Kees Cook
2024-05-15  5:04 ` kernel test robot
2024-05-15  8:11 ` Mark Rutland
2024-05-15 13:16   ` Carlos Llamas
2024-05-15 13:37   ` [PATCH v2] locking/atomic: scripts: fix ${atomic}_sub_and_test() kerneldoc Carlos Llamas
2024-05-16  8:45     ` Mark Rutland
2024-05-16  8:53       ` Peter Zijlstra
2024-05-16  9:49         ` Peter Zijlstra
2024-05-16 10:02           ` Mark Rutland
2024-06-05 14:04     ` [tip: locking/urgent] " tip-bot2 for Carlos Llamas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox