kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] RDMA/cxgb3: timeout condition is never true
@ 2013-06-18  7:27 Dan Carpenter
  2013-06-18 20:45 ` Steve Wise
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-06-18  7:27 UTC (permalink / raw)
  To: Steve Wise
  Cc: Roland Dreier, Sean Hefty, Hal Rosenstock,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

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>

diff --git a/drivers/infiniband/hw/cxgb3/iwch_qp.c b/drivers/infiniband/hw/cxgb3/iwch_qp.c
index e5649e8..b57c0be 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++;
 	}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] RDMA/cxgb3: timeout condition is never true
  2013-06-18  7:27 [patch] RDMA/cxgb3: timeout condition is never true Dan Carpenter
@ 2013-06-18 20:45 ` Steve Wise
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Wise @ 2013-06-18 20:45 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Steve Wise, Roland Dreier, Sean Hefty, Hal Rosenstock, linux-rdma,
	kernel-janitors

Acked-by: Steve Wise <swise@opengridcomputing.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-18 20:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-18  7:27 [patch] RDMA/cxgb3: timeout condition is never true Dan Carpenter
2013-06-18 20:45 ` Steve Wise

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).