[dpdk-dev] [PATCH 6/7] ixgbe: remove useless return
Ananyev, Konstantin
konstantin.ananyev at intel.com
Wed Feb 1 17:40:59 CET 2017
> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Stephen Hemminger
> Sent: Monday, January 9, 2017 11:30 PM
> To: dev at dpdk.org
> Cc: Stephen Hemminger <stephen at networkplumber.org>
> Subject: [dpdk-dev] [PATCH 6/7] ixgbe: remove useless return
>
> 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;
> }
>
> /**
> --
Acked-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
> 2.11.0
More information about the dev
mailing list