mthca_cq_clean(dev, to_mcq(qp->ibqp.send_cq)->cqn, qp->qpn); 
mthca_cq_clean(dev, to_mcq(qp->ibqp.send_cq)->cqn, qp->qpn, qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); 
void mthca_free_qp(struct mthca_dev *dev,		   struct mthca_qp *qp){	u8 status;	struct mthca_cq *send_cq;	struct mthca_cq *recv_cq;	send_cq = to_mcq(qp->ibqp.send_cq);	recv_cq = to_mcq(qp->ibqp.recv_cq);	/*	 * Lock CQs here, so that CQ polling code can do QP lookup	 * without taking a lock.	 */	spin_lock_irq(&send_cq->lock);	if (send_cq != recv_cq)		spin_lock(&recv_cq->lock);	spin_lock(&dev->qp_table.lock);	mthca_array_clear(&dev->qp_table.qp,			  qp->qpn & (dev->limits.num_qps - 1));	spin_unlock(&dev->qp_table.lock);	if (send_cq != recv_cq)		spin_unlock(&recv_cq->lock);	spin_unlock_irq(&send_cq->lock);	atomic_dec(&qp->refcount);	wait_event(qp->wait, !atomic_read(&qp->refcount));	if (qp->state != IB_QPS_RESET)		mthca_MODIFY_QP(dev, MTHCA_TRANS_ANY2RST, qp->qpn, 0, NULL, 0, &status);	/*	 * If this is a userspace QP, the buffers, MR, CQs and so on	 * will be cleaned up in userspace, so all we have to do is	 * unref the mem-free tables and free the QPN in our table.	 */	if (!qp->ibqp.uobject) {		mthca_cq_clean(dev, to_mcq(qp->ibqp.send_cq)->cqn, qp->qpn);		if (qp->ibqp.send_cq != qp->ibqp.recv_cq)			mthca_cq_clean(dev, to_mcq(qp->ibqp.recv_cq)->cqn, qp->qpn);		mthca_free_memfree(dev, qp);		mthca_free_wqe_buf(dev, qp);	}	mthca_unmap_memfree(dev, qp);	if (is_sqp(dev, qp)) {		atomic_dec(&(to_mpd(qp->ibqp.pd)->sqp_count));		dma_free_coherent(&dev->pdev->dev,				  to_msqp(qp)->header_buf_size,				  to_msqp(qp)->header_buf,				  to_msqp(qp)->header_dma);	} else		mthca_free(&dev->qp_table.alloc, qp->qpn);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/ec34a922d243c3401a694450734e9effb2bafbfe/mthca_qp.c/clean/drivers/infiniband/hw/mthca/mthca_qp.c