[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YaNCpSv67gS6ILEb@boqun-archlinux>
Date: Sun, 28 Nov 2021 16:49:41 +0800
From: Boqun Feng <boqun.feng@...il.com>
To: Mark Rutland <mark.rutland@....com>
Cc: linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>, arnd@...db.de,
lkp@...el.com, will@...nel.org
Subject: Re: [PATCH] locking/atomic: atomic64: remove unusable atomics
On Fri, Nov 26, 2021 at 11:59:23AM +0000, Mark Rutland wrote:
> The generic atomic64 implementation provides:
>
> * atomic64_and_return()
> * atomic64_or_return()
> * atomic64_xor_return()
>
> ... but none of these exist in the standard atomic64 API as described by
> scripts/atomic/atomics.tbl, and none of these have prototypes exposed by
> <asm-generic/atomic64.h>.
>
> The lkp kernel test robot noted this results in warnings when building with
> W=1:
>
> lib/atomic64.c:82:5: warning: no previous prototype for 'generic_atomic64_and_return' [-Wmissing-prototypes]
>
> lib/atomic64.c:82:5: warning: no previous prototype for 'generic_atomic64_or_return' [-Wmissing-prototypes]
>
> lib/atomic64.c:82:5: warning: no previous prototype for 'generic_atomic64_xor_return' [-Wmissing-prototypes]
>
> This appears to have been a thinko in commit:
>
> 28aa2bda2211f432 ("locking/atomic: Implement atomic{,64,_long}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()")
>
> ... where we grouped add/sub separately from and/ox/xor, so that we could avoid
> implementing _return forms for the latter group, but forgot to remove
> ATOMIC64_OP_RETURN() for that group.
>
> This doesn't cause any functional problem, but it's pointless to build code
> which cannot be used. Remove the unusable code. This does not affect add/sub,
> for which _return forms will still be built.
>
> Reported-by: kernel test robot <lkp@...el.com>
> Link: https://lore.kernel.org/r/202111120712.RtQHZohY-lkp@intel.com
> Signed-off-by: Mark Rutland <mark.rutland@....com>
FWIW
Acked-by: Boqun Feng <boqun.feng@...il.com>
Regards,
Boqun
> Cc: Arnd Bergmann <arnd@...db.de>
> Cc: Boqun Feng <boqun.feng@...il.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Will Deacon <will@...nel.org>
> ---
> lib/atomic64.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/lib/atomic64.c b/lib/atomic64.c
> index 3df653994177..caf895789a1e 100644
> --- a/lib/atomic64.c
> +++ b/lib/atomic64.c
> @@ -118,7 +118,6 @@ ATOMIC64_OPS(sub, -=)
> #undef ATOMIC64_OPS
> #define ATOMIC64_OPS(op, c_op) \
> ATOMIC64_OP(op, c_op) \
> - ATOMIC64_OP_RETURN(op, c_op) \
> ATOMIC64_FETCH_OP(op, c_op)
>
> ATOMIC64_OPS(and, &=)
> @@ -127,7 +126,6 @@ ATOMIC64_OPS(xor, ^=)
>
> #undef ATOMIC64_OPS
> #undef ATOMIC64_FETCH_OP
> -#undef ATOMIC64_OP_RETURN
> #undef ATOMIC64_OP
>
> s64 generic_atomic64_dec_if_positive(atomic64_t *v)
> --
> 2.30.2
>
Powered by blists - more mailing lists