diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-09-06 10:50:46 +0200 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2013-11-08 23:43:05 +0100 |
commit | 6ebacdfc07ca61ba258693c9b4c88f1ffbe8ccd7 (patch) | |
tree | 41dd5f8e054c318bdd689f828c532db653230315 /drivers/infiniband/hw/ocrdma | |
parent | Linux 3.12-rc7 (diff) | |
download | linux-6ebacdfc07ca61ba258693c9b4c88f1ffbe8ccd7.tar.xz linux-6ebacdfc07ca61ba258693c9b4c88f1ffbe8ccd7.zip |
RDMA/ocrdma: Silence an integer underflow warning
We recently added a cap on "max_wqe_allocated" in 43a6b4025c
('RDMA/ocrdma: Create IRD queue fix').
My static checker complains that the cap has a problem because it
casts large values to negative. "attrs->cap.max_send_wr" is a u32.
It comes from the user, but it's capped in ocrdma_check_qp_params() so
it can't wrap here.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/ocrdma')
-rw-r--r-- | drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c index 50219ab2279d..56bf32fcb62c 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c @@ -1783,7 +1783,7 @@ static int ocrdma_set_create_qp_sq_cmd(struct ocrdma_create_qp_req *cmd, u32 max_sges = attrs->cap.max_send_sge; /* QP1 may exceed 127 */ - max_wqe_allocated = min_t(int, attrs->cap.max_send_wr + 1, + max_wqe_allocated = min_t(u32, attrs->cap.max_send_wr + 1, dev->attr.max_wqe); status = ocrdma_build_q_conf(&max_wqe_allocated, |