mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org, akiyks@gmail.com,
	linux-doc@vger.kernel.org, kernel-team@meta.com,
	Will Deacon <will@kernel.org>, Boqun Feng <boqun.feng@gmail.com>,
	Mark Rutland <mark.rutland@arm.com>
Subject: Re: [PATCH locking/atomic 18/19] locking/atomic: Refrain from generating duplicate fallback kernel-doc
Date: Thu, 11 May 2023 22:18:37 +0200	[thread overview]
Message-ID: <20230511201837.GD2296992@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20230510181717.2200934-18-paulmck@kernel.org>

On Wed, May 10, 2023 at 11:17:16AM -0700, Paul E. McKenney wrote:
> The gen-atomics.sh script currently generates 42 duplicate definitions:
> 
> 	arch_atomic64_add_negative
> 	arch_atomic64_add_negative_acquire
> 	arch_atomic64_add_negative_release
> 	arch_atomic64_dec_return
> 	arch_atomic64_dec_return_acquire
> 	arch_atomic64_dec_return_release
> 	arch_atomic64_fetch_andnot
> 	arch_atomic64_fetch_andnot_acquire
> 	arch_atomic64_fetch_andnot_release
> 	arch_atomic64_fetch_dec
> 	arch_atomic64_fetch_dec_acquire
> 	arch_atomic64_fetch_dec_release
> 	arch_atomic64_fetch_inc
> 	arch_atomic64_fetch_inc_acquire
> 	arch_atomic64_fetch_inc_release
> 	arch_atomic64_inc_return
> 	arch_atomic64_inc_return_acquire
> 	arch_atomic64_inc_return_release
> 	arch_atomic64_try_cmpxchg
> 	arch_atomic64_try_cmpxchg_acquire
> 	arch_atomic64_try_cmpxchg_release
> 	arch_atomic_add_negative
> 	arch_atomic_add_negative_acquire
> 	arch_atomic_add_negative_release
> 	arch_atomic_dec_return
> 	arch_atomic_dec_return_acquire
> 	arch_atomic_dec_return_release
> 	arch_atomic_fetch_andnot
> 	arch_atomic_fetch_andnot_acquire
> 	arch_atomic_fetch_andnot_release
> 	arch_atomic_fetch_dec
> 	arch_atomic_fetch_dec_acquire
> 	arch_atomic_fetch_dec_release
> 	arch_atomic_fetch_inc
> 	arch_atomic_fetch_inc_acquire
> 	arch_atomic_fetch_inc_release
> 	arch_atomic_inc_return
> 	arch_atomic_inc_return_acquire
> 	arch_atomic_inc_return_release
> 	arch_atomic_try_cmpxchg
> 	arch_atomic_try_cmpxchg_acquire
> 	arch_atomic_try_cmpxchg_release
> 
> These duplicates are presumably to handle different architectures
> generating hand-coded definitions for different subsets of the atomic
> operations.  However, generating duplicate kernel-doc headers is
> undesirable.
> 
> Therefore, generate only the first kernel-doc definition in a group
> of duplicates.  A comment indicates the name of the function and the
> fallback script that generated it.

So my canonical solution to fixing kernel-doc related problems is this
trivial regex:

	s/\/\*\*/\/\*/

works every time.

And is *much* simpler than this:

>  scripts/atomic/chkdup.sh                     |  27 ++
>  scripts/atomic/fallbacks/acquire             |   3 +
>  scripts/atomic/fallbacks/add_negative        |   5 +
>  scripts/atomic/fallbacks/add_unless          |   5 +
>  scripts/atomic/fallbacks/andnot              |   5 +
>  scripts/atomic/fallbacks/dec                 |   5 +
>  scripts/atomic/fallbacks/dec_and_test        |   5 +
>  scripts/atomic/fallbacks/dec_if_positive     |   5 +
>  scripts/atomic/fallbacks/dec_unless_positive |   5 +
>  scripts/atomic/fallbacks/fence               |   3 +
>  scripts/atomic/fallbacks/fetch_add_unless    |   5 +
>  scripts/atomic/fallbacks/inc                 |   5 +
>  scripts/atomic/fallbacks/inc_and_test        |   5 +
>  scripts/atomic/fallbacks/inc_not_zero        |   5 +
>  scripts/atomic/fallbacks/inc_unless_negative |   5 +
>  scripts/atomic/fallbacks/read_acquire        |   5 +
>  scripts/atomic/fallbacks/release             |   3 +
>  scripts/atomic/fallbacks/set_release         |   5 +
>  scripts/atomic/fallbacks/sub_and_test        |   5 +
>  scripts/atomic/fallbacks/try_cmpxchg         |   5 +
>  scripts/atomic/gen-atomics.sh                |   4 +

  parent reply	other threads:[~2023-05-11 20:18 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-10 18:15 [PATCH locking/atomics 0/19] Add kernel-doc for more atomic operations Paul E. McKenney
2023-05-10 18:16 ` [PATCH locking/atomic 01/19] locking/atomic: Fix fetch_add_unless missing-period typo Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 02/19] locking/atomic: Add "@" before "true" and "false" for fallback templates Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 03/19] locking/atomic: Add kernel-doc and docbook_oldnew variables for headers Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 04/19] locking/atomic: Add kernel-doc header for arch_${atomic}_${pfx}inc${sfx}${order} Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 05/19] locking/atomic: Add kernel-doc header for arch_${atomic}_${pfx}dec${sfx}${order} Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 06/19] locking/atomic: Add kernel-doc header for arch_${atomic}_${pfx}andnot${sfx}${order} Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 07/19] locking/atomic: Add kernel-doc header for arch_${atomic}_try_cmpxchg${order} Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 08/19] locking/atomic: Add kernel-doc header for arch_${atomic}_dec_if_positive Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 09/19] locking/atomic: Add kernel-doc header for arch_${atomic}_dec_unless_positive Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 10/19] locking/atomic: Add kernel-doc header for arch_${atomic}_inc_unless_negative Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 11/19] locking/atomic: Add kernel-doc header for arch_${atomic}_set_release Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 12/19] locking/atomic: Add kernel-doc header for arch_${atomic}_read_acquire Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 13/19] locking/atomic: Script to auto-generate acquire, fence, and release headers Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 14/19] locking/atomic: Add kernel-doc header for arch_${atomic}_${pfx}${name}${sfx}_acquire Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 15/19] locking/atomic: Add kernel-doc header for arch_${atomic}_${pfx}${name}${sfx}_release Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 16/19] locking/atomic: Add kernel-doc header for arch_${atomic}_${pfx}${name}${sfx} Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 17/19] x86/atomic.h: Remove duplicate kernel-doc headers Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 18/19] locking/atomic: Refrain from generating duplicate fallback kernel-doc Paul E. McKenney
2023-05-11 17:10   ` Mark Rutland
2023-05-11 19:12     ` Paul E. McKenney
2023-05-12 13:18       ` Mark Rutland
2023-05-12 16:01         ` Paul E. McKenney
2023-05-12 17:03           ` Mark Rutland
2023-05-12 18:42             ` Paul E. McKenney
2023-05-13  2:11               ` Paul E. McKenney
2023-05-13 23:58                 ` Akira Yokosawa
2023-05-14  1:14                   ` Paul E. McKenney
2023-05-16 16:52                     ` Mark Rutland
2023-05-16 18:42                       ` Paul E. McKenney
2023-05-11 19:38     ` Peter Zijlstra
2023-05-11 19:53       ` Paul E. McKenney
2023-05-11 20:01         ` Peter Zijlstra
2023-05-11 20:25           ` Paul E. McKenney
2023-05-11 20:46             ` Peter Zijlstra
2023-05-11 20:48               ` Peter Zijlstra
2023-05-11 21:24                 ` Paul E. McKenney
2023-05-12 13:30       ` Mark Rutland
2023-05-11 20:18   ` Peter Zijlstra [this message]
2023-05-11 20:29     ` Paul E. McKenney
2023-05-10 18:17 ` [PATCH locking/atomic 19/19] docs: Add atomic operations to the driver basic API documentation Paul E. McKenney
2023-05-16 21:33   ` Kees Cook
2023-05-17 10:10     ` Paul E. McKenney
2023-05-22 12:30       ` Mark Rutland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230511201837.GD2296992@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akiyks@gmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=paulmck@kernel.org \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome