IB/ipath: replace uses of LIST_POISON
[pandora-kernel.git] / drivers / infiniband / hw / ipath / ipath_qp.c
index b26146c..0924a21 100644 (file)
@@ -375,10 +375,10 @@ static void ipath_error_qp(struct ipath_qp *qp)
 
        spin_lock(&dev->pending_lock);
        /* XXX What if its already removed by the timeout code? */
-       if (qp->timerwait.next != LIST_POISON1)
-               list_del(&qp->timerwait);
-       if (qp->piowait.next != LIST_POISON1)
-               list_del(&qp->piowait);
+       if (!list_empty(&qp->timerwait))
+               list_del_init(&qp->timerwait);
+       if (!list_empty(&qp->piowait))
+               list_del_init(&qp->piowait);
        spin_unlock(&dev->pending_lock);
 
        wc.status = IB_WC_WR_FLUSH_ERR;
@@ -712,10 +712,8 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
                             init_attr->qp_type == IB_QPT_RC ?
                             ipath_do_rc_send : ipath_do_uc_send,
                             (unsigned long)qp);
-               qp->piowait.next = LIST_POISON1;
-               qp->piowait.prev = LIST_POISON2;
-               qp->timerwait.next = LIST_POISON1;
-               qp->timerwait.prev = LIST_POISON2;
+               INIT_LIST_HEAD(&qp->piowait);
+               INIT_LIST_HEAD(&qp->timerwait);
                qp->state = IB_QPS_RESET;
                qp->s_wq = swq;
                qp->s_size = init_attr->cap.max_send_wr + 1;
@@ -785,10 +783,10 @@ int ipath_destroy_qp(struct ib_qp *ibqp)
 
        /* Make sure the QP isn't on the timeout list. */
        spin_lock_irqsave(&dev->pending_lock, flags);
-       if (qp->timerwait.next != LIST_POISON1)
-               list_del(&qp->timerwait);
-       if (qp->piowait.next != LIST_POISON1)
-               list_del(&qp->piowait);
+       if (!list_empty(&qp->timerwait))
+               list_del_init(&qp->timerwait);
+       if (!list_empty(&qp->piowait))
+               list_del_init(&qp->piowait);
        spin_unlock_irqrestore(&dev->pending_lock, flags);
 
        /*
@@ -857,10 +855,10 @@ void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc)
 
        spin_lock(&dev->pending_lock);
        /* XXX What if its already removed by the timeout code? */
-       if (qp->timerwait.next != LIST_POISON1)
-               list_del(&qp->timerwait);
-       if (qp->piowait.next != LIST_POISON1)
-               list_del(&qp->piowait);
+       if (!list_empty(&qp->timerwait))
+               list_del_init(&qp->timerwait);
+       if (!list_empty(&qp->piowait))
+               list_del_init(&qp->piowait);
        spin_unlock(&dev->pending_lock);
 
        ipath_cq_enter(to_icq(qp->ibqp.send_cq), wc, 1);