Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1b88eb9 authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

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: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
Acked-by: default avatarDavid Howells <dhowells@redhat.com>
parent d36cc701
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -903,7 +903,9 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
 * the reader-accessible portions of the linked structure.
 * the reader-accessible portions of the linked structure.
 */
 */
#define RCU_INIT_POINTER(p, v) \
#define RCU_INIT_POINTER(p, v) \
		p = (typeof(*v) __force __rcu *)(v)
	do { \
		p = (typeof(*v) __force __rcu *)(v); \
	} while (0)


/**
/**
 * RCU_POINTER_INITIALIZER() - statically initialize an RCU protected pointer
 * RCU_POINTER_INITIALIZER() - statically initialize an RCU protected pointer