net: remove an redundant continue
Subsystems (5)
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
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
@@ -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
PATCH 2/3 nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics
In reply to zhong jiangContinue 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
@@ -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
Re: [PATCH 2/3] nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics
From: zhong jiang <[email protected]>
Date: Wed, 4 Sep 2019 11:46:23 +0800
Quoted 3 lines
Continue is not needed at the bottom of a loop.
Signed-off-by zhong jiang <[email protected]>
Applied to net-next.
Re: [PATCH 2/3] nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics
In reply to zhong jiangQuoted 12 lines · zhong jiang
Continue is not needed at the bottom of a loop.
Signed-off-by zhong jiang <[email protected]>--- 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
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))
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.
Signed-off-by zhong jiang <[email protected]>--- 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@@ -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)).
PATCH 3/3 ath10k: Drop unnecessary continue in ath10k_mac_update_vif_chan
In reply to zhong jiangContinue 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
@@ -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