Skip to contentSkip to conversation

net/mlx4: remove useless assignment

PATCH In review Michael Baum 2 participants 2 messages Jun 24, 2020 – Jun 29, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx4: remove useless assignment

The mlx4_ibv_device_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.

---
 drivers/net/mlx4/mlx4.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/mlx4/mlx4.c +0 -1
index ff270b4..1657ea3 100644
@@ -492,7 +492,6 @@ struct mlx4_conf {
 			   &pci_addr->bus,
 			   &pci_addr->devid,
 			   &pci_addr->function) == 4) {
-			ret = 0;
 			break;
 		}
 	}
Signature · 1 line
1.8.3.1
#1 lore raw

Hi,

Quoted 36 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Michael Baum
Sent: Wednesday, June 24, 2020 4:31 PM
To: [email protected]
Cc: Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>
Subject: [dpdk-dev] [PATCH] net/mlx4: remove useless assignment

The mlx4_ibv_device_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.

---
 drivers/net/mlx4/mlx4.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/mlx4/mlx4.c +0 -2
index ff270b4..1657ea3 100644
@@ -492,7 +492,6 @@ struct mlx4_conf {
 			   &pci_addr->bus,
 			   &pci_addr->devid,
 			   &pci_addr->function) == 4) {
-			ret = 0;
 			break;
 		}
 	}
--
Quoted 1 line

1.8.3.1

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh