Cast the increment added to wq->tail when send completions are
processed to uint16_t to avoid using wrong values caused by standard
integer promotions.
Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
if (is_send) {
wq = &(*cur_qp)->sq;
wqe_index = ntohs(cqe->wqe_index);
- wq->tail += wqe_index - (uint16_t) wq->tail;
+ wq->tail += (uint16_t) (wqe_index - (uint16_t) wq->tail);
wc->wr_id = wq->wrid[wq->tail & (wq->max - 1)];
++wq->tail;
} else if ((*cur_qp)->ibv_qp.srq) {