From: Dan Carpenter Date: Mon, 19 Jul 2010 20:30:14 +0000 (+0000) Subject: RDMA/cxgb3: Clean up signed check of unsigned variable X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=3d4f9a28e0f543e2a633d54f0f37f6e81a7701cd;p=deliverable%2Flinux.git RDMA/cxgb3: Clean up signed check of unsigned variable Q_FREECNT() returns the number of spaces free. This should never be a negative amount. Also the num_wrs is an unsigned int so it can never be less than zero. Signed-off-by: Dan Carpenter Acked-by: Steve Wise Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/hw/cxgb3/iwch_qp.c b/drivers/infiniband/hw/cxgb3/iwch_qp.c index ae47bfd22bd5..6adc13fc1e4c 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_qp.c +++ b/drivers/infiniband/hw/cxgb3/iwch_qp.c @@ -371,7 +371,7 @@ int iwch_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, } num_wrs = Q_FREECNT(qhp->wq.sq_rptr, qhp->wq.sq_wptr, qhp->wq.sq_size_log2); - if (num_wrs <= 0) { + if (num_wrs == 0) { spin_unlock_irqrestore(&qhp->lock, flag); err = -ENOMEM; goto out; @@ -554,7 +554,7 @@ int iwch_bind_mw(struct ib_qp *qp, } num_wrs = Q_FREECNT(qhp->wq.sq_rptr, qhp->wq.sq_wptr, qhp->wq.sq_size_log2); - if ((num_wrs) <= 0) { + if (num_wrs == 0) { spin_unlock_irqrestore(&qhp->lock, flag); return -ENOMEM; }