net/mlx5: Unify and improve command interface
[linux-2.6-block.git] / drivers / infiniband / hw / mlx5 / main.c
index a84bb766fc62874bc45303268c25b961e45cd4f1..6fb77d791045afd68609dc60772c580b66fcf5d7 100644 (file)
@@ -233,23 +233,19 @@ static int set_roce_addr(struct ib_device *device, u8 port_num,
                         const union ib_gid *gid,
                         const struct ib_gid_attr *attr)
 {
-       struct mlx5_ib_dev *dev = to_mdev(device);
-       u32  in[MLX5_ST_SZ_DW(set_roce_address_in)];
-       u32 out[MLX5_ST_SZ_DW(set_roce_address_out)];
+       struct mlx5_ib_dev *dev = to_mdev(device);
+       u32  in[MLX5_ST_SZ_DW(set_roce_address_in)]  = {0};
+       u32 out[MLX5_ST_SZ_DW(set_roce_address_out)] = {0};
        void *in_addr = MLX5_ADDR_OF(set_roce_address_in, in, roce_address);
        enum rdma_link_layer ll = mlx5_ib_port_link_layer(device, port_num);
 
        if (ll != IB_LINK_LAYER_ETHERNET)
                return -EINVAL;
 
-       memset(in, 0, sizeof(in));
-
        ib_gid_to_mlx5_roce_addr(gid, attr, in_addr);
 
        MLX5_SET(set_roce_address_in, in, roce_address_index, index);
        MLX5_SET(set_roce_address_in, in, opcode, MLX5_CMD_OP_SET_ROCE_ADDRESS);
-
-       memset(out, 0, sizeof(out));
        return mlx5_cmd_exec(dev->mdev, in, sizeof(in), out, sizeof(out));
 }