diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-06-18 10:27:38 +0300 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2013-06-20 04:51:52 -0700 |
commit | 21bfd4706268c85c9d17ca2fd48de3b19c9d40db (patch) | |
tree | 5627c83e66849ee3107de6ccf42502aa2b669a20 /drivers/infiniband/hw | |
parent | fedaf4ffc224a194e2d13a3ec2abe5df0bc94258 (diff) |
RDMA/cxgb3: Timeout condition is never true
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>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r-- | drivers/infiniband/hw/cxgb3/iwch_qp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/cxgb3/iwch_qp.c b/drivers/infiniband/hw/cxgb3/iwch_qp.c index e5649e8b215..b57c0befd96 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_qp.c +++ b/drivers/infiniband/hw/cxgb3/iwch_qp.c @@ -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++; } |