Skip to contentSkip to conversation

net/mlx5: Declare 'rt' as corresponding enum type

PATCH In review Austin Kim 2 participants 3 messages Sep 10, 2019 – Sep 11, 2019

Subsystems (4)
lore
Share & tools
lore

Austin Kim

author
#0 lore raw

PATCH 1/1 net/mlx5: Declare 'rt' as corresponding enum type

When building kernel with clang, we can observe below warning message:

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c:1080:9:
warning: implicit conversion from enumeration type 'enum mlx5_reformat_ctx_type'
to different enumeration type 'enum mlx5dr_action_type' [- Wenum-conversion]

	rt = MLX5_REFORMAT_TYPE_L2_TO_L2_TUNNEL;
       			  ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c:1082:9:
warning: implicit conversion from enumeration type 'enum mlx5_reformat_ctx_type'
to different enumeration type 'enum mlx5dr_action_type' [-   Wenum-conversion]
	rt = MLX5_REFORMAT_TYPE_L2_TO_L3_TUNNEL;
        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c:1084:51:
warning: implicit conversion from enumeration type 'enum mlx5dr_action_type'
to different enumeration type 'enum mlx5_reformat_ctx_type' [-  Wenum-conversion]
	ret = mlx5dr_cmd_create_reformat_ctx(dmn->mdev, rt, data_sz, data,
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~            ^~

Declare 'rt' as corresponding enum mlx5_reformat_ctx_type type.

---
 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c +1 -1
index a02f87f..7d81a77 100644
@@ -1074,7 +1074,7 @@ dr_action_create_reformat_action(struct mlx5dr_domain *dmn,
 	case DR_ACTION_TYP_L2_TO_TNL_L2:
 	case DR_ACTION_TYP_L2_TO_TNL_L3:
 	{
-		enum mlx5dr_action_type rt;
+		enum mlx5_reformat_ctx_type rt;
 
 		if (action->action_type == DR_ACTION_TYP_L2_TO_TNL_L2)
 			rt = MLX5_REFORMAT_TYPE_L2_TO_L2_TUNNEL;
Signature · 1 line
2.6.2
#1 lore raw
Quoted 22 lines · Austin Kim

When building kernel with clang, we can observe below warning message:

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c:1080:9:
warning: implicit conversion from enumeration type 'enum mlx5_reformat_ctx_type'
to different enumeration type 'enum mlx5dr_action_type' [- Wenum-
conversion]

	rt = MLX5_REFORMAT_TYPE_L2_TO_L2_TUNNEL;
       			  ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c:1082:9:
warning: implicit conversion from enumeration type 'enum mlx5_reformat_ctx_type'
to different enumeration type 'enum mlx5dr_action_type' [- Wenum-
conversion]

	rt = MLX5_REFORMAT_TYPE_L2_TO_L3_TUNNEL;
        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c:1084:51:
warning: implicit conversion from enumeration type 'enum mlx5dr_action_type'
to different enumeration type 'enum mlx5_reformat_ctx_type' [- Wenum-conversion]

Quoted 7 lines
	ret = mlx5dr_cmd_create_reformat_ctx(dmn->mdev, rt, data_sz,
data,
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~            ^~

Declare 'rt' as corresponding enum mlx5_reformat_ctx_type type.

Hi Austin, Thanks for the patch:

We already have a similar patch queued for submission.
https://patchwork.ozlabs.org/patch/1158175/

Quoted 20 lines
---
 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c index a02f87f..7d81a77 100644

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c +1 -1
@@ -1074,7 +1074,7 @@ dr_action_create_reformat_action(struct
 mlx5dr_domain *dmn,
 	case DR_ACTION_TYP_L2_TO_TNL_L2:
 	case DR_ACTION_TYP_L2_TO_TNL_L3:
 	{
-		enum mlx5dr_action_type rt;
+		enum mlx5_reformat_ctx_type rt;
 
 		if (action->action_type == DR_ACTION_TYP_L2_TO_TNL_L2)

rt = MLX5_REFORMAT_TYPE_L2_TO_L2_TUNNEL;

author
#2 lore raw

It is good to hear that similar patch was submitted. Thanks for notification.

Thanks,
Austin Kim

2019년 9월 11일 (수) 오전 2:59, Saeed Mahameed <[email protected]>님이 작성:

Quoted 56 lines · Austin Kim
Quoted 22 lines

When building kernel with clang, we can observe below warning message:

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c:1080:9:
warning: implicit conversion from enumeration type 'enum mlx5_reformat_ctx_type'
to different enumeration type 'enum mlx5dr_action_type' [- Wenum-
conversion]

      rt = MLX5_REFORMAT_TYPE_L2_TO_L2_TUNNEL;
                                ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c:1082:9:
warning: implicit conversion from enumeration type 'enum mlx5_reformat_ctx_type'
to different enumeration type 'enum mlx5dr_action_type' [- Wenum-
conversion]

      rt = MLX5_REFORMAT_TYPE_L2_TO_L3_TUNNEL;
        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c:1084:51:
warning: implicit conversion from enumeration type 'enum mlx5dr_action_type'
to different enumeration type 'enum mlx5_reformat_ctx_type' [- Wenum-conversion]

Quoted 7 lines
      ret = mlx5dr_cmd_create_reformat_ctx(dmn->mdev, rt, data_sz,
data,
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~            ^~

Declare 'rt' as corresponding enum mlx5_reformat_ctx_type type.

Hi Austin, Thanks for the patch:

We already have a similar patch queued for submission.
https://patchwork.ozlabs.org/patch/1158175/

Quoted 20 lines
---
 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c index a02f87f..7d81a77 100644

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c +1 -1
@@ -1074,7 +1074,7 @@ dr_action_create_reformat_action(struct
 mlx5dr_domain *dmn,
      case DR_ACTION_TYP_L2_TO_TNL_L2:
      case DR_ACTION_TYP_L2_TO_TNL_L3:
      {
-             enum mlx5dr_action_type rt;
+             enum mlx5_reformat_ctx_type rt;
 
              if (action->action_type == DR_ACTION_TYP_L2_TO_TNL_L2)
                      rt = MLX5_REFORMAT_TYPE_L2_TO_L2_TUNNEL;