Skip to content

Commit

Permalink
IB/mlx4: Fix up SRQ limit_watermark endianness
Browse files Browse the repository at this point in the history
mlx4_srq_query() returns a big-endian 16-bit value through an int *,
which screws up sparse checking.  Fix this so that a CPU-endian value
is returned.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Roland Dreier committed Oct 10, 2007
1 parent ca6de17 commit d7dc3cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/mlx4/srq.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ int mlx4_ib_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *srq_attr)
if (ret)
return ret;

srq_attr->srq_limit = be16_to_cpu(limit_watermark);
srq_attr->srq_limit = limit_watermark;
srq_attr->max_wr = srq->msrq.max - 1;
srq_attr->max_sge = srq->msrq.max_gs;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/mlx4/srq.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ int mlx4_srq_query(struct mlx4_dev *dev, struct mlx4_srq *srq, int *limit_waterm
err = mlx4_QUERY_SRQ(dev, mailbox, srq->srqn);
if (err)
goto err_out;
*limit_watermark = srq_context->limit_watermark;
*limit_watermark = be16_to_cpu(srq_context->limit_watermark);

err_out:
mlx4_free_cmd_mailbox(dev, mailbox);
Expand Down

0 comments on commit d7dc3cc

Please sign in to comment.