Commit 1ee87d7a authored by David S. Miller's avatar David S. Miller

Merge branch 'mlx4-static-checker-warnings'

Tariq Toukan says:

====================
Fix mlx4 static checker warnings

This patchset contains fixes for static checker warnings
in the mlx4 Core and Eth drivers.

Patch 1 fixes an actual bug discovered by the checker.
Patches 2 and 3 fix the warnings without functional changes.

Series generated against net-next commit:
c49c777f qed: Delete redundant check on dcb_app priority
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents acb40d84 7ba5e7bd
...@@ -53,7 +53,7 @@ void mlx4_en_fill_qp_context(struct mlx4_en_priv *priv, int size, int stride, ...@@ -53,7 +53,7 @@ void mlx4_en_fill_qp_context(struct mlx4_en_priv *priv, int size, int stride,
if (is_tx) { if (is_tx) {
context->sq_size_stride = ilog2(size) << 3 | (ilog2(stride) - 4); context->sq_size_stride = ilog2(size) << 3 | (ilog2(stride) - 4);
if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_PORT_REMAP) if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_PORT_REMAP)
context->params2 |= MLX4_QP_BIT_FPP; context->params2 |= cpu_to_be32(MLX4_QP_BIT_FPP);
} else { } else {
context->sq_size_stride = ilog2(TXBB_SIZE) - 4; context->sq_size_stride = ilog2(TXBB_SIZE) - 4;
......
...@@ -718,7 +718,7 @@ void mlx4_en_xmit_doorbell(struct mlx4_en_tx_ring *ring) ...@@ -718,7 +718,7 @@ void mlx4_en_xmit_doorbell(struct mlx4_en_tx_ring *ring)
#else #else
iowrite32be( iowrite32be(
#endif #endif
ring->doorbell_qpn, (__force u32)ring->doorbell_qpn,
ring->bf.uar->map + MLX4_SEND_DOORBELL); ring->bf.uar->map + MLX4_SEND_DOORBELL);
} }
......
...@@ -57,12 +57,12 @@ MODULE_PARM_DESC(enable_qos, "Enable Enhanced QoS support (default: off)"); ...@@ -57,12 +57,12 @@ MODULE_PARM_DESC(enable_qos, "Enable Enhanced QoS support (default: off)");
#define MLX4_GET(dest, source, offset) \ #define MLX4_GET(dest, source, offset) \
do { \ do { \
void *__p = (char *) (source) + (offset); \ void *__p = (char *) (source) + (offset); \
u64 val; \ __be64 val; \
switch (sizeof(dest)) { \ switch (sizeof(dest)) { \
case 1: (dest) = *(u8 *) __p; break; \ case 1: (dest) = *(u8 *) __p; break; \
case 2: (dest) = be16_to_cpup(__p); break; \ case 2: (dest) = be16_to_cpup(__p); break; \
case 4: (dest) = be32_to_cpup(__p); break; \ case 4: (dest) = be32_to_cpup(__p); break; \
case 8: val = get_unaligned((u64 *)__p); \ case 8: val = get_unaligned((__be64 *)__p); \
(dest) = be64_to_cpu(val); break; \ (dest) = be64_to_cpu(val); break; \
default: __buggy_use_of_MLX4_GET(); \ default: __buggy_use_of_MLX4_GET(); \
} \ } \
......
...@@ -925,7 +925,7 @@ int mlx4_qp_to_ready(struct mlx4_dev *dev, struct mlx4_mtt *mtt, ...@@ -925,7 +925,7 @@ int mlx4_qp_to_ready(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
context->flags &= cpu_to_be32(~(0xf << 28)); context->flags &= cpu_to_be32(~(0xf << 28));
context->flags |= cpu_to_be32(states[i + 1] << 28); context->flags |= cpu_to_be32(states[i + 1] << 28);
if (states[i + 1] != MLX4_QP_STATE_RTR) if (states[i + 1] != MLX4_QP_STATE_RTR)
context->params2 &= ~MLX4_QP_BIT_FPP; context->params2 &= ~cpu_to_be32(MLX4_QP_BIT_FPP);
err = mlx4_qp_modify(dev, mtt, states[i], states[i + 1], err = mlx4_qp_modify(dev, mtt, states[i], states[i + 1],
context, 0, 0, qp); context, 0, 0, qp);
if (err) { if (err) {
......
...@@ -3185,7 +3185,7 @@ static int verify_qp_parameters(struct mlx4_dev *dev, ...@@ -3185,7 +3185,7 @@ static int verify_qp_parameters(struct mlx4_dev *dev,
optpar = be32_to_cpu(*(__be32 *) inbox->buf); optpar = be32_to_cpu(*(__be32 *) inbox->buf);
if (slave != mlx4_master_func_num(dev)) { if (slave != mlx4_master_func_num(dev)) {
qp_ctx->params2 &= ~MLX4_QP_BIT_FPP; qp_ctx->params2 &= ~cpu_to_be32(MLX4_QP_BIT_FPP);
/* setting QP rate-limit is disallowed for VFs */ /* setting QP rate-limit is disallowed for VFs */
if (qp_ctx->rate_limit_params) if (qp_ctx->rate_limit_params)
return -EPERM; return -EPERM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment