- Subject: [tip:core/rcu] rcu: Remove return value from rcu_assign_pointer()
- From: "tip-bot for Paul E. McKenney" <paulmck@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 6 Jul 2012 07:58:37 -0700
- Cc: paulmck@xxxxxxxxxxxxxxxxxx, hpa@xxxxxxxxx, mingo@xxxxxxxxxx, mathieu.desnoyers@xxxxxxxxxxxx, josh@xxxxxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx
- Git-commit-id: e9023c4061054cbf59c5288068118a4d0b152f01
- Reply-to: linux-kernel@xxxxxxxxxxxxxxx, mingo@xxxxxxxxxx, hpa@xxxxxxxxx, paulmck@xxxxxxxxxxxxxxxxxx, mathieu.desnoyers@xxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, josh@xxxxxxxxxxxxxxxx
- Robot-id: <tip-bot.git.kernel.org>
- Robot-unsubscribe: Contact <mailto:hpa@xxxxxxxxxx> to get blacklisted from these emails
Commit-ID: e9023c4061054cbf59c5288068118a4d0b152f01
Gitweb: http://git.kernel.org/tip/e9023c4061054cbf59c5288068118a4d0b152f01
Author: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
AuthorDate: Wed, 16 May 2012 15:51:08 -0700
Committer: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
CommitDate: Mon, 2 Jul 2012 12:34:23 -0700
rcu: Remove return value from rcu_assign_pointer()
The return value from rcu_assign_pointer() is not used, and using it
would be quite ugly, for example:
q = rcu_assign_pointer(global_p, p);
To prevent this sort of ugliness from spreading, this commit wraps
rcu_assign_pointer() in a do-while loop.
Reported-by: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
Reported-by: Josh Triplett <josh@xxxxxxxxxxxxxxxx>
Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Josh Triplett <josh@xxxxxxxxxxxxxxxx>
---
include/linux/rcupdate.h | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index abf44d8..fb8e6db 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -513,10 +513,10 @@ static inline void rcu_preempt_sleep_check(void)
(_________p1); \
})
#define __rcu_assign_pointer(p, v, space) \
- ({ \
+ do { \
smp_wmb(); \
(p) = (typeof(*v) __force space *)(v); \
- })
+ } while (0)
/**
@@ -851,7 +851,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
*
* Assigns the specified value to the specified RCU-protected
* pointer, ensuring that any concurrent RCU readers will see
- * any prior initialization. Returns the value assigned.
+ * any prior initialization.
*
* Inserts memory barriers on architectures that require them
* (which is most of them), and also prevents the compiler from
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux USB Devel]
[Linux Video &Media]
[Video for Linux]
[Linux Audio Users]
[Photo]
[Yosemite News]
[Yosemite Photos]
[Free Online Dating]
[Linux Kernel]
[Linux SCSI]
[XFree86]