net/mlx5: fix gcc 10 enum-conversion warning
authorKevin Traynor <ktraynor@redhat.com>
Fri, 20 Mar 2020 16:47:42 +0000 (16:47 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 5 May 2020 13:54:27 +0000 (15:54 +0200)
commit869ea2e62de7f981c4b69fc0b63d32ca0c1213cd
tree96c47fbed06e1b00974f7ad5eb15fca6edec889d
parentb756f2980718bf2cb1c8f57762f42c656986998d
net/mlx5: fix gcc 10 enum-conversion warning

gcc 10.0.1 reports warnings when using mlx5_rte_flow enums
with rte_flow type enums. For example:

../drivers/net/mlx5/mlx5_flow.c: In function ‘flow_hairpin_split’:
../drivers/net/mlx5/mlx5_flow.c:3406:19:
warning: implicit conversion from ‘enum mlx5_rtedflow_action_type’ to
         ‘enum rte_flow_action_type’ [-Wenum-conversion]
 3406 |  tag_action->type = MLX5_RTE_FLOW_ACTION_TYPE_TAG;
      |                   ^
../drivers/net/mlx5/mlx5_flow.c:3419:13:
warning: implicit conversion from ‘enum mlx5_rte_flow_item_type’
         to ‘enum rte_flow_item_type’ [-Wenum-conversion]
 3419 |  item->type = MLX5_RTE_FLOW_ITEM_TYPE_TAG;
      |             ^

Fix by casting to the correct enum.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
drivers/net/mlx5/mlx5_flow.c