summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c7eaf61)
To follow the way the Linux kernel implements atomic_set(), we change
some API functions so they don't return any value anymore.
This is now the case for:
uatomic_set()
rcu_set_pointer()
rcu_assign_pointer()
This API change is very minor. In all instances of the Linux kernel
using rcu_assign_pointer(), none currently care about its return value.
However, we keep ABI compatibility: rcu_set_pointer_sym() still returns
the "v" value, even though it is not used by its wrapper macro anymore.
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
#define rcu_dereference _rcu_dereference
/*
#define rcu_dereference _rcu_dereference
/*
- * rcu_cmpxchg_pointer(type **ptr, type *new, type *old)
+ * type *rcu_cmpxchg_pointer(type **ptr, type *new, type *old)
* type *rcu_xchg_pointer(type **ptr, type *new)
* type *rcu_xchg_pointer(type **ptr, type *new)
- * type *rcu_set_pointer(type **ptr, type *new)
+ * void rcu_set_pointer(type **ptr, type *new)
*
* RCU pointer updates.
* @ptr: address of the pointer to modify
*
* RCU pointer updates.
* @ptr: address of the pointer to modify
+/*
+ * Note: rcu_set_pointer_sym returns @v because we don't want to break
+ * the ABI. At the API level, rcu_set_pointer() now returns void. Use of
+ * the return value is therefore deprecated, and will cause a build
+ * error.
+ */
extern void *rcu_set_pointer_sym(void **p, void *v);
#define rcu_set_pointer(p, v) \
extern void *rcu_set_pointer_sym(void **p, void *v);
#define rcu_set_pointer(p, v) \
typeof(*(p)) _________pv = (v); \
typeof(*(p)) _________pv = (v); \
- typeof(*(p)) _________p1 = URCU_FORCE_CAST(typeof(*(p)), \
- rcu_set_pointer_sym(URCU_FORCE_CAST(void **, p), \
- _________pv)); \
- (_________p1); \
- })
+ (void) rcu_set_pointer_sym(URCU_FORCE_CAST(void **, p), \
+ _________pv); \
+ } while (0)
#endif /* !_LGPL_SOURCE */
/*
#endif /* !_LGPL_SOURCE */
/*
- * rcu_assign_pointer(type *ptr, type *new)
+ * void rcu_assign_pointer(type *ptr, type *new)
*
* Same as rcu_set_pointer, but takes the pointer to assign to rather than its
* address as first parameter. Provided for compatibility with the Linux kernel
*
* Same as rcu_set_pointer, but takes the pointer to assign to rather than its
* address as first parameter. Provided for compatibility with the Linux kernel
#define _rcu_set_pointer(p, v) \
#define _rcu_set_pointer(p, v) \
typeof(*p) _________pv = (v); \
if (!__builtin_constant_p(v) || \
((v) != NULL)) \
cmm_wmb(); \
uatomic_set(p, _________pv); \
typeof(*p) _________pv = (v); \
if (!__builtin_constant_p(v) || \
((v) != NULL)) \
cmm_wmb(); \
uatomic_set(p, _________pv); \
/**
* _rcu_assign_pointer - assign (publicize) a pointer to a new data structure
/**
* _rcu_assign_pointer - assign (publicize) a pointer to a new data structure
#endif
#ifndef uatomic_set
#endif
#ifndef uatomic_set
-#define uatomic_set(addr, v) CMM_STORE_SHARED(*(addr), (v))
+#define uatomic_set(addr, v) ((void) CMM_STORE_SHARED(*(addr), (v)))
#endif
#ifndef uatomic_read
#endif
#ifndef uatomic_read