Skip to contentSkip to conversation

atomic-long: Fix warnings on arm64

PATCH In review Bradley Bolen 2 participants 2 messages Jan 27, 2018 – Jan 28, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 atomic-long: Fix warnings on arm64

Several inline functions in this file reference undefined functions in U-Boot. For example:

atomic-long.h:73:9: warning: implicit declaration of function 'atomic64_sub_and_test'
atomic-long.h:80:9: warning: implicit declaration of function 'atomic64_dec_and_test'
atomic-long.h:87:9: warning: implicit declaration of function 'atomic64_inc_and_test'

Handle this the same as the 32 bit build by wrapping these functions in a __UBOOT__ check.

---
 include/asm-generic/atomic-long.h | 2 ++
 1 file changed, 2 insertions(+)
include/asm-generic/atomic-long.h +2 -0
index d0469ef2e3..32f288b706 100644
@@ -66,6 +66,7 @@ static inline void atomic_long_sub(long i, atomic_long_t *l)
 	atomic64_sub(i, v);
 }
 
+#ifndef __UBOOT__
 static inline int atomic_long_sub_and_test(long i, atomic_long_t *l)
 {
 	atomic64_t *v = (atomic64_t *)l;
@@ -135,6 +136,7 @@ static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u)
 	(atomic64_cmpxchg((atomic64_t *)(l), (old), (new)))
 #define atomic_long_xchg(v, new) \
 	(atomic64_xchg((atomic64_t *)(v), (new)))
+#endif  /*  __UBOOT__ */
 
 #else  /*  BITS_PER_LONG == 64  */
 
Signature · 1 line
2.14.1
#1 lore raw
Quoted 10 lines · Bradley Bolen

Several inline functions in this file reference undefined functions in U-Boot. For example:

atomic-long.h:73:9: warning: implicit declaration of function 'atomic64_sub_and_test'
atomic-long.h:80:9: warning: implicit declaration of function 'atomic64_dec_and_test'
atomic-long.h:87:9: warning: implicit declaration of function 'atomic64_inc_and_test'

Quoted 4 lines

Handle this the same as the 32 bit build by wrapping these functions in a __UBOOT__ check.

Applied to u-boot/master, thanks!

[Michal, I think this ends up being easier to maintain long-term than your RFC patch that removed all of these functions]

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180128/981e38fa/attachment.sig>