fix: uatomic_set return value compile fix for non-x86 arch.
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 24 May 2012 15:51:03 +0000 (11:51 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 24 May 2012 15:51:03 +0000 (11:51 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu-bp.c
urcu-pointer.c
urcu/uatomic/x86.h

index 7c91e0a9ce8bb40b3ef688011cc0cc9cf933b536..67eae07b6e1b3f69c9cc4739d524dd45de899daf 100644 (file)
--- 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)
index 45dad2b276ba589b04794f7ce663c9bf1f6a76ba..61e35da5d718a05dc0f8fad69b0aeb370c7c1d66 100644 (file)
@@ -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)
index ce1ce5e9b48b75f193d9c80f81977c2005888492..a139228346cb64b5eed2425f0d71f8f78f58e9dc 100644 (file)
@@ -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,
This page took 0.026924 seconds and 4 git commands to generate.