aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-07-19 16:30:14 -0400
committerRoland Dreier <rolandd@cisco.com>2010-07-21 13:57:25 -0400
commit3d4f9a28e0f543e2a633d54f0f37f6e81a7701cd (patch)
tree8bc818be7f388dd94437f4bfe61e0c42ad93782c /drivers/infiniband
parent589643be6693c46fbc54bae77745f336c8ed4bcc (diff)
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 <error27@gmail.com> Acked-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_qp.c4
1 files changed, 2 insertions, 2 deletions
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,
371 } 371 }
372 num_wrs = Q_FREECNT(qhp->wq.sq_rptr, qhp->wq.sq_wptr, 372 num_wrs = Q_FREECNT(qhp->wq.sq_rptr, qhp->wq.sq_wptr,
373 qhp->wq.sq_size_log2); 373 qhp->wq.sq_size_log2);
374 if (num_wrs <= 0) { 374 if (num_wrs == 0) {
375 spin_unlock_irqrestore(&qhp->lock, flag); 375 spin_unlock_irqrestore(&qhp->lock, flag);
376 err = -ENOMEM; 376 err = -ENOMEM;
377 goto out; 377 goto out;
@@ -554,7 +554,7 @@ int iwch_bind_mw(struct ib_qp *qp,
554 } 554 }
555 num_wrs = Q_FREECNT(qhp->wq.sq_rptr, qhp->wq.sq_wptr, 555 num_wrs = Q_FREECNT(qhp->wq.sq_rptr, qhp->wq.sq_wptr,
556 qhp->wq.sq_size_log2); 556 qhp->wq.sq_size_log2);
557 if ((num_wrs) <= 0) { 557 if (num_wrs == 0) {
558 spin_unlock_irqrestore(&qhp->lock, flag); 558 spin_unlock_irqrestore(&qhp->lock, flag);
559 return -ENOMEM; 559 return -ENOMEM;
560 } 560 }