[linux-next] net/mlx5: remove redundant ret variable

Message ID 202211022150403300510@zte.com.cn
State New
Headers
Series [linux-next] net/mlx5: remove redundant ret variable |

Commit Message

zhang.songyi@zte.com.cn Nov. 2, 2022, 1:50 p.m. UTC
  From 74562e313cf9a1b96c7030f27964f826a0c2572d Mon Sep 17 00:00:00 2001
From: zhang songyi <zhang.songyi@zte.com.cn>
Date: Wed, 2 Nov 2022 20:48:08 +0800
Subject: [PATCH linux-next] net/mlx5: remove redundant ret variable

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

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>
---
 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--
2.15.2
  

Comments

Leon Romanovsky Nov. 6, 2022, 6:56 p.m. UTC | #1
On Wed, Nov 02, 2022 at 09:50:40PM +0800, zhang.songyi@zte.com.cn wrote:
> From 74562e313cf9a1b96c7030f27964f826a0c2572d Mon Sep 17 00:00:00 2001
> From: zhang songyi <zhang.songyi@zte.com.cn>
> Date: Wed, 2 Nov 2022 20:48:08 +0800
> Subject: [PATCH linux-next] net/mlx5: remove redundant ret variable

Subject line should be "[PATCH net-next] ..." for all net patches.
And please use git send-email utility to send the patches.

Thanks

> 
> Return value from mlx5dr_send_postsend_action() directly instead of taking
> this in another redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c
> index a4476cb4c3b3..fd2d31cdbcf9 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c
> @@ -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,
> --
> 2.15.2
  
Saeed Mahameed Nov. 11, 2022, 10:31 p.m. UTC | #2
On 06 Nov 20:56, Leon Romanovsky wrote:
>On Wed, Nov 02, 2022 at 09:50:40PM +0800, zhang.songyi@zte.com.cn wrote:
>> From 74562e313cf9a1b96c7030f27964f826a0c2572d Mon Sep 17 00:00:00 2001
>> From: zhang songyi <zhang.songyi@zte.com.cn>
>> Date: Wed, 2 Nov 2022 20:48:08 +0800
>> Subject: [PATCH linux-next] net/mlx5: remove redundant ret variable
>
>Subject line should be "[PATCH net-next] ..." for all net patches.
>And please use git send-email utility to send the patches.
>
>Thanks

Also this patch doesn't apply to net-next.
  

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c
index a4476cb4c3b3..fd2d31cdbcf9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c
@@ -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,