[6/7] common/mlx5: remove useless assignment

Message ID 1592998387-28181-6-git-send-email-michaelba@mellanox.com (mailing list archive)
State Superseded, archived
Headers
Series [1/7] common/mlx5: fix code arrangement in tag allocation |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Michael Baum June 24, 2020, 11:33 a.m. UTC
  The mlx5_dev_to_pci_addr function defines a variable called ret inside a
loop and uses it.

During the loop, the function assigns a value within the variable and
breaks from the loop, so that this assigning has done nothing and is
actually unnecessary.

Remove the unnecessary assigning.

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/common/mlx5/linux/mlx5_common_os.c | 1 -
 1 file changed, 1 deletion(-)
  

Comments

Raslan Darawsheh June 29, 2020, 8:44 a.m. UTC | #1
Hi

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Michael Baum
> Sent: Wednesday, June 24, 2020 2:33 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>
> Subject: [dpdk-dev] [PATCH 6/7] common/mlx5: remove useless assignment
> 
> The mlx5_dev_to_pci_addr function defines a variable called ret inside a
> loop and uses it.
> 
> During the loop, the function assigns a value within the variable and
> breaks from the loop, so that this assigning has done nothing and is
> actually unnecessary.
> 
> Remove the unnecessary assigning.
> 
> Signed-off-by: Michael Baum <michaelba@mellanox.com>
> Acked-by: Matan Azrad <matan@mellanox.com>
> ---
>  drivers/common/mlx5/linux/mlx5_common_os.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/common/mlx5/linux/mlx5_common_os.c
> b/drivers/common/mlx5/linux/mlx5_common_os.c
> index e422e95..e74aa89 100644
> --- a/drivers/common/mlx5/linux/mlx5_common_os.c
> +++ b/drivers/common/mlx5/linux/mlx5_common_os.c
> @@ -66,7 +66,6 @@
>  			   &pci_addr->bus,
>  			   &pci_addr->devid,
>  			   &pci_addr->function) == 4) {
> -			ret = 0;
>  			break;
>  		}
>  	}
> --
> 1.8.3.1

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh
  

Patch

diff --git a/drivers/common/mlx5/linux/mlx5_common_os.c b/drivers/common/mlx5/linux/mlx5_common_os.c
index e422e95..e74aa89 100644
--- a/drivers/common/mlx5/linux/mlx5_common_os.c
+++ b/drivers/common/mlx5/linux/mlx5_common_os.c
@@ -66,7 +66,6 @@ 
 			   &pci_addr->bus,
 			   &pci_addr->devid,
 			   &pci_addr->function) == 4) {
-			ret = 0;
 			break;
 		}
 	}