Skip to content

Commit

Permalink
IB/mlx4: Fix warning in rounding up queue sizes
Browse files Browse the repository at this point in the history
Doing max(1, foo) where foo is u32 generates a warning, because 1 is a
signed constant.  Fix this by using 1U instead.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Roland Dreier committed Jun 12, 2007
1 parent 614c3c8 commit 42c059e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/infiniband/hw/mlx4/qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ static int set_rq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
if (is_user && (!cap->max_recv_wr || !cap->max_recv_sge))
return -EINVAL;

qp->rq.max = roundup_pow_of_two(max(1, cap->max_recv_wr));
qp->rq.max_gs = roundup_pow_of_two(max(1, cap->max_recv_sge));
qp->rq.max = roundup_pow_of_two(max(1U, cap->max_recv_wr));
qp->rq.max_gs = roundup_pow_of_two(max(1U, cap->max_recv_sge));
qp->rq.wqe_shift = ilog2(qp->rq.max_gs * sizeof (struct mlx4_wqe_data_seg));
}

Expand Down

0 comments on commit 42c059e

Please sign in to comment.