Skip to contentSkip to conversation

net/mlx5: remove redundant ret variable

PATCH In review [email protected] 3 participants 3 messages Dec 5, 2022 – Dec 6, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: remove redundant ret variable

From: zhang songyi <[email protected]>

Return value from mlx5dr_send_postsend_action() directly instead of taking this in another redundant variable.

---
 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c +1 -4
index a4476cb4c3b3..fd2d31cdbcf9 100644
@@ -724,7 +724,6 @@ int mlx5dr_send_postsend_action(struct mlx5dr_domain *dmn,
 				struct mlx5dr_action *action)
 {
 	struct postsend_info send_info = {};
-	int ret;
 
 	send_info.write.addr = (uintptr_t)action->rewrite->data;
 	send_info.write.length = action->rewrite->num_of_actions *
@@ -734,9 +733,7 @@ int mlx5dr_send_postsend_action(struct mlx5dr_domain *dmn,
 		mlx5dr_icm_pool_get_chunk_mr_addr(action->rewrite->chunk);
 	send_info.rkey = mlx5dr_icm_pool_get_chunk_rkey(action->rewrite->chunk);
 
-	ret = dr_postsend_icm_data(dmn, &send_info);
-
-	return ret;
+	return dr_postsend_icm_data(dmn, &send_info);
 }
 
 static int dr_modify_qp_rst2init(struct mlx5_core_dev *mdev,
Signature · 1 line
2.15.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 23 lines · On 05/12/2022 8:24, [email protected] wrote:

From: zhang songyi <[email protected]>

Return value from mlx5dr_send_postsend_action() directly instead of taking this in another redundant variable.

---
 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c +0 -1
index a4476cb4c3b3..fd2d31cdbcf9 100644
@@ -724,7 +724,6 @@ int mlx5dr_send_postsend_action(struct mlx5dr_domain *dmn,
 				struct mlx5dr_action *action)
 {
 	struct postsend_info send_info = {};
-	int ret;
 
 	send_info.write.addr = (uintptr_t)action->rewrite->data;
 	send_info.write.length = action->rewrite->num_of_actions *

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c int mlx5dr_send_postsend_action(struct mlx5dr_domain *dmn, · line 739

Quoted 10 lines
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c +1 -3
@@ -734,9 +733,7 @@ int mlx5dr_send_postsend_action(struct mlx5dr_domain *dmn,
 		mlx5dr_icm_pool_get_chunk_mr_addr(action->rewrite->chunk);
 	send_info.rkey = mlx5dr_icm_pool_get_chunk_rkey(action->rewrite->chunk);
 
-	ret = dr_postsend_icm_data(dmn, &send_info);
-
-	return ret;
+	return dr_postsend_icm_data(dmn, &send_info);
 }
 
 static int dr_modify_qp_rst2init(struct mlx5_core_dev *mdev,