wfqueue: fix type-incorrect assignment
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 9 Aug 2011 12:37:14 +0000 (08:37 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 9 Aug 2011 12:37:14 +0000 (08:37 -0400)
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 <pbonzini@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu/static/wfqueue.h

index 77828ca1d8c046f41d3da76c8f7d5b0253e076ba..19314f5f9223498ba45b749c4af678ed607cf2fb 100644 (file)
@@ -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
This page took 0.025705 seconds and 4 git commands to generate.