IB/mlx4: Fix up SRQ limit_watermark endianness
authorRoland Dreier <rolandd@cisco.com>
Wed, 10 Oct 2007 02:59:06 +0000 (19:59 -0700)
committerRoland Dreier <rolandd@cisco.com>
Wed, 10 Oct 2007 02:59:06 +0000 (19:59 -0700)
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>
drivers/infiniband/hw/mlx4/srq.c
drivers/net/mlx4/srq.c

index 408748fb5285697d24c44b8cd5bebbb19a780f68..e7e9a3d0dac343f5dbd333d87a1839be635f12db 100644 (file)
@@ -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;
 
index b061c86d6839aa3bd72aa0a7828f98c477b4bec9..31b255a32915a54485c248e4ffdffe61ad96127b 100644 (file)
@@ -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);