From: Paolo Bonzini Date: Tue, 9 Aug 2011 12:37:14 +0000 (-0400) Subject: wfqueue: fix type-incorrect assignment X-Git-Tag: v0.6.5~58 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=75635e2ac36765b49698a32d91767220917de807;p=userspace-rcu.git wfqueue: fix type-incorrect assignment The "old_tail = q->tail, q->tail = node" assignment in wfqueue is not type safe; q->tail is a pointer to pointer to node and the correct value to assign is &node->next. While the arithmetic is the same, it is better to be tidy. Signed-off-by: Paolo Bonzini Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu/static/wfqueue.h b/urcu/static/wfqueue.h index 77828ca..19314f5 100644 --- a/urcu/static/wfqueue.h +++ b/urcu/static/wfqueue.h @@ -75,7 +75,7 @@ static inline void _cds_wfq_enqueue(struct cds_wfq_queue *q, * structure containing node and setting node->next to NULL before * publication. */ - old_tail = uatomic_xchg(&q->tail, node); + old_tail = uatomic_xchg(&q->tail, &node->next); /* * At this point, dequeuers see a NULL old_tail->next, which indicates * that the queue is being appended to. The following store will append