2019-09-04 03:50:38

by zhong jiang

[permalink] [raw]
Subject: [PATCH 0/3] 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(-)

--
1.7.12.4


2019-09-04 03:50:39

by zhong jiang

[permalink] [raw]
Subject: [PATCH 2/3] nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics

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(-)

diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
index 986464d..68db47d 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
@@ -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))
--
1.7.12.4

2019-09-04 03:50:47

by zhong jiang

[permalink] [raw]
Subject: [PATCH 3/3] ath10k: Drop unnecessary continue in ath10k_mac_update_vif_chan

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

Signed-off-by: zhong jiang <[email protected]>
---
drivers/net/wireless/ath/ath10k/mac.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 12dad65..91e4635 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -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
--
1.7.12.4

2019-09-04 03:51:22

by zhong jiang

[permalink] [raw]
Subject: [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.

Signed-off-by: zhong jiang <[email protected]>
---
drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
index aa8a095..4805b84 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
@@ -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 {
--
1.7.12.4

2019-09-06 18:43:07

by David Miller

[permalink] [raw]
Subject: 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

> Continue is not needed at the bottom of a loop.
>
> Signed-off-by: zhong jiang <[email protected]>

Applied to net-next.

2019-09-17 08:33:53

by Jakub Kicinski

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

On Wed, 4 Sep 2019 11:46:23 +0800, zhong jiang wrote:
> 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(-)
>
> diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
> index 986464d..68db47d 100644
> --- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
> +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
> @@ -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..

> }
>
> if (list_empty(&pf->vnics))

2019-09-17 14:13:15

by zhong jiang

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

On 2019/9/17 10:45, Jakub Kicinski wrote:
> On Wed, 4 Sep 2019 11:46:23 +0800, zhong jiang wrote:
>> 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(-)
>>
>> diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
>> index 986464d..68db47d 100644
>> --- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
>> +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
>> @@ -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.
Thanks, I miss that information you object to above modification.

Sincerely,
zhong jiang
> I guess there's no use in fighting the bots..
>
>> }
>>
>> if (list_empty(&pf->vnics))
>
> .
>