Skip to contentSkip to conversation

net: remove an redundant continue

PATCH Applied zhong jiang 3 participants 7 messages Sep 4, 2019 – Sep 17, 2019

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover net: remove an redundant continue

With the help of Coccinelle. we find some place to replace.

@@

for (...;...;...) {
...

   if (...) {
     ...

- continue;
}
}

zhong jiang (3):
rtlwifi: Remove an unnecessary continue in
_rtl8723be_phy_config_bb_with_pgheaderfile
nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics
ath10k: Drop unnecessary continue in ath10k_mac_update_vif_chan

 drivers/net/ethernet/netronome/nfp/nfp_net_main.c    | 4 +---
 drivers/net/wireless/ath/ath10k/mac.c                | 4 +---
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 1 -
 3 files changed, 2 insertions(+), 7 deletions(-)
Signature · 1 line
1.7.12.4
#1 lore raw

PATCH 1/3 rtlwifi: Remove an unnecessary continue in _rtl8723be_phy_config_bb_with_pgheaderfile

Continue is not needed at the bottom of a loop. Hence just drop it.

---
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c +0 -1
index aa8a095..4805b84 100644
@@ -732,7 +732,6 @@ static bool _rtl8723be_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw,
 				else
 					_rtl8723be_store_tx_power_by_rate(hw,
 							v1, v2, v3, v4, v5, v6);
-				continue;
 			}
 		}
 	} else {
Signature · 1 line
1.7.12.4
#2 lore raw

PATCH 2/3 nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics

In reply to zhong jiang

Continue is not needed at the bottom of a loop.

---
 drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/netronome/nfp/nfp_net_main.c +1 -3
index 986464d..68db47d 100644
@@ -205,10 +205,8 @@ static void nfp_net_pf_free_vnics(struct nfp_pf *pf)
 		ctrl_bar += NFP_PF_CSR_SLICE_SIZE;
 
 		/* Kill the vNIC if app init marked it as invalid */
-		if (nn->port && nn->port->type == NFP_PORT_INVALID) {
+		if (nn->port && nn->port->type == NFP_PORT_INVALID)
 			nfp_net_pf_free_vnic(pf, nn);
-			continue;
-		}
 	}
 
 	if (list_empty(&pf->vnics))
Signature · 1 line
1.7.12.4
#4 lore raw

Re: [PATCH 2/3] nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics

In reply to zhong jiang
Quoted 12 lines · zhong jiang

Continue is not needed at the bottom of a loop.

---
 drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/netronome/nfp/nfp_net_main.c +0 -0
index 986464d..68db47d 100644

drivers/net/ethernet/netronome/nfp/nfp_net_main.c static void nfp_net_pf_free_vnics(struct nfp_pf *pf) · line 211

Quoted 8 lines
drivers/net/ethernet/netronome/nfp/nfp_net_main.c +1 -3
@@ -205,10 +205,8 @@ static void nfp_net_pf_free_vnics(struct nfp_pf *pf)
 		ctrl_bar += NFP_PF_CSR_SLICE_SIZE;
 
 		/* Kill the vNIC if app init marked it as invalid */
-		if (nn->port && nn->port->type == NFP_PORT_INVALID) {
+		if (nn->port && nn->port->type == NFP_PORT_INVALID)
 			nfp_net_pf_free_vnic(pf, nn);
-			continue;
-		}

Ugh, I already nack at least one patch like this, this continue makes the _intent_ of the code more clear, the compiler will ignore it anyway.

I guess there's no use in fighting the bots..

Quoted 3 lines
drivers/net/ethernet/netronome/nfp/nfp_net_main.c +0 -0
 	}
 
 	if (list_empty(&pf->vnics))
#5 lore raw

Re: [PATCH 2/3] nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics

Quoted 15 lines · Jakub Kicinski
Quoted 14 lines · zhong jiang

Continue is not needed at the bottom of a loop.

---
 drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/netronome/nfp/nfp_net_main.c +0 -0
index 986464d..68db47d 100644
@@ -205,10 +205,8 @@ static void nfp_net_pf_free_vnics(struct nfp_pf *pf)
 		ctrl_bar += NFP_PF_CSR_SLICE_SIZE;
 
Quoted 8 lines

drivers/net/ethernet/netronome/nfp/nfp_net_main.c static void nfp_net_pf_free_vnics(struct nfp_pf *pf) · line 211

Quoted 6 lines
drivers/net/ethernet/netronome/nfp/nfp_net_main.c +1 -3
 		/* Kill the vNIC if app init marked it as invalid */
-		if (nn->port && nn->port->type == NFP_PORT_INVALID) {
+		if (nn->port && nn->port->type == NFP_PORT_INVALID)
 			nfp_net_pf_free_vnic(pf, nn);
-			continue;
-		}

Ugh, I already nack at least one patch like this, this continue makes the _intent_ of the code more clear, the compiler will ignore it anyway.

Thanks, I miss that information you object to above modification.

Sincerely,
zhong jiang

Quoted 8 lines

I guess there's no use in fighting the bots..

drivers/net/ethernet/netronome/nfp/nfp_net_main.c static void nfp_net_pf_free_vnics(struct nfp_pf *pf) · line 212

Quoted 3 lines
drivers/net/ethernet/netronome/nfp/nfp_net_main.c +0 -0
 	}
 
 	if (list_empty(&pf->vnics))

.

#6 lore raw

PATCH 3/3 ath10k: Drop unnecessary continue in ath10k_mac_update_vif_chan

In reply to zhong jiang

Continue is not needed at the bottom of a loop. Hence just remove it.

---
 drivers/net/wireless/ath/ath10k/mac.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/mac.c +1 -3
index 12dad65..91e4635 100644
@@ -7804,11 +7804,9 @@ static int ath10k_ampdu_action(struct ieee80211_hw *hw,
 			continue;
 
 		ret = ath10k_wmi_vdev_down(ar, arvif->vdev_id);
-		if (ret) {
+		if (ret)
 			ath10k_warn(ar, "failed to down vdev %d: %d\n",
 				    arvif->vdev_id, ret);
-			continue;
-		}
 	}
 
 	/* All relevant vdevs are downed and associated channel resources
Signature · 1 line
1.7.12.4