From: Mathieu Desnoyers Date: Thu, 24 May 2012 15:51:03 +0000 (-0400) Subject: fix: uatomic_set return value compile fix for non-x86 arch. X-Git-Tag: v0.7.1~1 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=424d4ed5e7b0ca5e05c3078f15abf473c6879521;p=urcu.git fix: uatomic_set return value compile fix for non-x86 arch. Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu-bp.c b/urcu-bp.c index 7c91e0a..67eae07 100644 --- a/urcu-bp.c +++ b/urcu-bp.c @@ -439,7 +439,8 @@ void *rcu_dereference_sym_bp(void *p) void *rcu_set_pointer_sym_bp(void **p, void *v) { cmm_wmb(); - return uatomic_set(p, v); + uatomic_set(p, v); + return v; } void *rcu_xchg_pointer_sym_bp(void **p, void *v) diff --git a/urcu-pointer.c b/urcu-pointer.c index 45dad2b..61e35da 100644 --- a/urcu-pointer.c +++ b/urcu-pointer.c @@ -40,7 +40,8 @@ void *rcu_dereference_sym(void *p) void *rcu_set_pointer_sym(void **p, void *v) { cmm_wmb(); - return uatomic_set(p, v); + uatomic_set(p, v); + return v; } void *rcu_xchg_pointer_sym(void **p, void *v) diff --git a/urcu/uatomic/x86.h b/urcu/uatomic/x86.h index ce1ce5e..a139228 100644 --- a/urcu/uatomic/x86.h +++ b/urcu/uatomic/x86.h @@ -39,7 +39,7 @@ struct __uatomic_dummy { }; #define __hp(x) ((struct __uatomic_dummy *)(x)) -#define _uatomic_set(addr, v) CMM_STORE_SHARED(*(addr), (v)) +#define _uatomic_set(addr, v) ((void) CMM_STORE_SHARED(*(addr), (v))) /* cmpxchg */ @@ -529,12 +529,16 @@ extern int __rcu_cas_init(void); : (compat_uatomic_##insn)) \ : (compat_uatomic_##insn)))) +/* + * We leave the return value so we don't break the ABI, but remove the + * return value from the API. + */ extern unsigned long _compat_uatomic_set(void *addr, unsigned long _new, int len); #define compat_uatomic_set(addr, _new) \ - ((__typeof__(*(addr))) _compat_uatomic_set((addr), \ - caa_cast_long_keep_sign(_new), \ - sizeof(*(addr)))) + ((void) _compat_uatomic_set((addr), \ + caa_cast_long_keep_sign(_new), \ + sizeof(*(addr)))) extern unsigned long _compat_uatomic_xchg(void *addr,