[dpdk-dev] [PATCH 6/7] ixgbe: remove useless return

Stephen Hemminger stephen at networkplumber.org
Tue Jan 10 00:30:21 CET 2017


If all goto's lead to a return, then better to get rid of goto.

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 drivers/net/ixgbe/ixgbe_82599_bypass.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_82599_bypass.c b/drivers/net/ixgbe/ixgbe_82599_bypass.c
index de9fa5a7..af55cc0a 100644
--- a/drivers/net/ixgbe/ixgbe_82599_bypass.c
+++ b/drivers/net/ixgbe/ixgbe_82599_bypass.c
@@ -73,7 +73,7 @@ ixgbe_set_fiber_fixed_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed)
 					   &eeprom_data);
 	if (status) {
 		PMD_DRV_LOG(ERR, "Failed to read Rx Rate Select RS0");
-		goto out;
+		return;
 	}
 
 	eeprom_data = (eeprom_data & ~IXGBE_SFF_SOFT_RS_SELECT_MASK) & rs;
@@ -83,7 +83,7 @@ ixgbe_set_fiber_fixed_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed)
 					    eeprom_data);
 	if (status) {
 		PMD_DRV_LOG(ERR, "Failed to write Rx Rate Select RS0");
-		goto out;
+		return;
 	}
 
 	/* Set RS1 */
@@ -92,7 +92,7 @@ ixgbe_set_fiber_fixed_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed)
 					   &eeprom_data);
 	if (status) {
 		PMD_DRV_LOG(ERR, "Failed to read Rx Rate Select RS1");
-		goto out;
+		return;
 	}
 
 	eeprom_data = (eeprom_data & ~IXGBE_SFF_SOFT_RS_SELECT_MASK) & rs;
@@ -102,10 +102,8 @@ ixgbe_set_fiber_fixed_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed)
 					    eeprom_data);
 	if (status) {
 		PMD_DRV_LOG(ERR, "Failed to write Rx Rate Select RS1");
-		goto out;
+		return;
 	}
-out:
-	return;
 }
 
 /**
-- 
2.11.0



More information about the dev mailing list