net/mlx4_core: Fix sparse warning
authorEyal Perry <eyalpe@mellanox.com>
Sun, 2 Mar 2014 08:25:03 +0000 (10:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Mar 2014 01:04:01 +0000 (20:04 -0500)
This patch force conversion to u32 to fix the following sparse warning:
drivers/net/ethernet/mellanox/mlx4/fw.c:1822:53: warning: restricted __be32
degrades to integer

Casting to u32 is safe here, because token will be returned as is
from the hardware without any modification.

Signed-off-by: Eyal Perry <eyalpe@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/fw.c

index 91b69ff4b4a20f8f2bd2f6c9405cf6ab60af7f6a..9cdf452140daab876713f12245e84de3978875de 100644 (file)
@@ -1890,7 +1890,8 @@ void mlx4_opreq_action(struct work_struct *work)
                        err = EINVAL;
                        break;
                }
-               err = mlx4_cmd(dev, 0, ((u32) err | cpu_to_be32(token) << 16),
+               err = mlx4_cmd(dev, 0, ((u32) err |
+                                       (__force u32)cpu_to_be32(token) << 16),
                               1, MLX4_CMD_GET_OP_REQ, MLX4_CMD_TIME_CLASS_A,
                               MLX4_CMD_NATIVE);
                if (err) {