Skip to content

Commit 5fb6e8c

Browse files
mrutland-armPeter Zijlstra
authored andcommitted
locking/atomic: atomic64: Remove unusable atomic ops
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: 28aa2bd ("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@intel.com> Signed-off-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Boqun Feng <boqun.feng@gmail.com> Link: https://lore.kernel.org/r/20211126115923.41489-1-mark.rutland@arm.com
1 parent 6773cc3 commit 5fb6e8c

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

lib/atomic64.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ ATOMIC64_OPS(sub, -=)
118118
#undef ATOMIC64_OPS
119119
#define ATOMIC64_OPS(op, c_op) \
120120
ATOMIC64_OP(op, c_op) \
121-
ATOMIC64_OP_RETURN(op, c_op) \
122121
ATOMIC64_FETCH_OP(op, c_op)
123122

124123
ATOMIC64_OPS(and, &=)
@@ -127,7 +126,6 @@ ATOMIC64_OPS(xor, ^=)
127126

128127
#undef ATOMIC64_OPS
129128
#undef ATOMIC64_FETCH_OP
130-
#undef ATOMIC64_OP_RETURN
131129
#undef ATOMIC64_OP
132130

133131
s64 generic_atomic64_dec_if_positive(atomic64_t *v)

0 commit comments

Comments
 (0)