[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230511201837.GD2296992@hirez.programming.kicks-ass.net>
Date: Thu, 11 May 2023 22:18:37 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: "Paul E. McKenney" <paulmck@...nel.org>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org, akiyks@...il.com,
linux-doc@...r.kernel.org, kernel-team@...a.com,
Will Deacon <will@...nel.org>,
Boqun Feng <boqun.feng@...il.com>,
Mark Rutland <mark.rutland@....com>
Subject: Re: [PATCH locking/atomic 18/19] locking/atomic: Refrain from
generating duplicate fallback kernel-doc
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 +
Powered by blists - more mailing lists