diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-05-16 18:42:30 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-07-02 15:34:23 -0400 |
commit | d1b88eb9e3bccaa43fb5d1bde1cbe210b3434731 (patch) | |
tree | 0cb3f4f8b8b9234c306a738d41233db9d8ee709c /include | |
parent | d36cc701b28983ea2c8d80afe68aae5452aea3bf (diff) |
rcu: Remove return value from RCU_INIT_POINTER()
The return value from RCU_INIT_POINTER() is not used, and using it
would be quite ugly, for example:
q = RCU_INIT_POINTER(global_p, p);
To prevent this sort of ugliness from appearing, this commit wraps
RCU_INIT_POINTER() in a do-while loop.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/rcupdate.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index ffe24c09e53d..abf44d89c6ce 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -903,7 +903,9 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
903 | * the reader-accessible portions of the linked structure. | 903 | * the reader-accessible portions of the linked structure. |
904 | */ | 904 | */ |
905 | #define RCU_INIT_POINTER(p, v) \ | 905 | #define RCU_INIT_POINTER(p, v) \ |
906 | p = (typeof(*v) __force __rcu *)(v) | 906 | do { \ |
907 | p = (typeof(*v) __force __rcu *)(v); \ | ||
908 | } while (0) | ||
907 | 909 | ||
908 | /** | 910 | /** |
909 | * RCU_POINTER_INITIALIZER() - statically initialize an RCU protected pointer | 911 | * RCU_POINTER_INITIALIZER() - statically initialize an RCU protected pointer |