RDMA/cxgb3: Timeout condition is never true
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 18 Jun 2013 07:27:38 +0000 (10:27 +0300)
committerRoland Dreier <roland@purestorage.com>
Thu, 20 Jun 2013 11:51:52 +0000 (04:51 -0700)
This is a static checker fix.  "count" is unsigned so it's never -1.
Since "count" is 16 bits and the addition operation is implicitly
casted to int then there is no wrapping here.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/cxgb3/iwch_qp.c

index e5649e8b215d90f038c9cc3f2d61bf0a796bcf43..b57c0befd962b837f45b36719663a945caf3cdbe 100644 (file)
@@ -883,7 +883,8 @@ u16 iwch_rqes_posted(struct iwch_qp *qhp)
 {
        union t3_wr *wqe = qhp->wq.queue;
        u16 count = 0;
-       while ((count+1) != 0 && fw_riwrh_opcode((struct fw_riwrh *)wqe) == T3_WR_RCV) {
+
+       while (count < USHRT_MAX && fw_riwrh_opcode((struct fw_riwrh *)wqe) == T3_WR_RCV) {
                count++;
                wqe++;
        }