linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] net: remove an redundant continue
@ 2019-09-04  3:46 zhong jiang
  2019-09-04  3:46 ` [PATCH 1/3] rtlwifi: Remove an unnecessary continue in _rtl8723be_phy_config_bb_with_pgheaderfile zhong jiang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: zhong jiang @ 2019-09-04  3:46 UTC (permalink / raw)
  To: davem, kvalo, pkshih; +Cc: zhongjiang, netdev, linux-kernel

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] rtlwifi: Remove an unnecessary continue in _rtl8723be_phy_config_bb_with_pgheaderfile
  2019-09-04  3:46 [PATCH 0/3] net: remove an redundant continue zhong jiang
@ 2019-09-04  3:46 ` zhong jiang
  2019-09-04  3:46 ` [PATCH 2/3] nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics zhong jiang
  2019-09-04  3:46 ` [PATCH 3/3] ath10k: Drop unnecessary continue in ath10k_mac_update_vif_chan zhong jiang
  2 siblings, 0 replies; 7+ messages in thread
From: zhong jiang @ 2019-09-04  3:46 UTC (permalink / raw)
  To: davem, kvalo, pkshih; +Cc: zhongjiang, netdev, linux-kernel

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

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics
  2019-09-04  3:46 [PATCH 0/3] net: remove an redundant continue zhong jiang
  2019-09-04  3:46 ` [PATCH 1/3] rtlwifi: Remove an unnecessary continue in _rtl8723be_phy_config_bb_with_pgheaderfile zhong jiang
@ 2019-09-04  3:46 ` zhong jiang
  2019-09-06 12:58   ` David Miller
  2019-09-17  2:45   ` Jakub Kicinski
  2019-09-04  3:46 ` [PATCH 3/3] ath10k: Drop unnecessary continue in ath10k_mac_update_vif_chan zhong jiang
  2 siblings, 2 replies; 7+ messages in thread
From: zhong jiang @ 2019-09-04  3:46 UTC (permalink / raw)
  To: davem, kvalo, pkshih; +Cc: zhongjiang, netdev, linux-kernel

Continue is not needed at the bottom of a loop.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] ath10k: Drop unnecessary continue in ath10k_mac_update_vif_chan
  2019-09-04  3:46 [PATCH 0/3] net: remove an redundant continue zhong jiang
  2019-09-04  3:46 ` [PATCH 1/3] rtlwifi: Remove an unnecessary continue in _rtl8723be_phy_config_bb_with_pgheaderfile zhong jiang
  2019-09-04  3:46 ` [PATCH 2/3] nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics zhong jiang
@ 2019-09-04  3:46 ` zhong jiang
  2 siblings, 0 replies; 7+ messages in thread
From: zhong jiang @ 2019-09-04  3:46 UTC (permalink / raw)
  To: davem, kvalo, pkshih; +Cc: zhongjiang, netdev, linux-kernel

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

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics
  2019-09-04  3:46 ` [PATCH 2/3] nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics zhong jiang
@ 2019-09-06 12:58   ` David Miller
  2019-09-17  2:45   ` Jakub Kicinski
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2019-09-06 12:58 UTC (permalink / raw)
  To: zhongjiang; +Cc: kvalo, pkshih, netdev, linux-kernel

From: zhong jiang <zhongjiang@huawei.com>
Date: Wed, 4 Sep 2019 11:46:23 +0800

> Continue is not needed at the bottom of a loop.
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>

Applied to net-next.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics
  2019-09-04  3:46 ` [PATCH 2/3] nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics zhong jiang
  2019-09-06 12:58   ` David Miller
@ 2019-09-17  2:45   ` Jakub Kicinski
  2019-09-17  3:07     ` zhong jiang
  1 sibling, 1 reply; 7+ messages in thread
From: Jakub Kicinski @ 2019-09-17  2:45 UTC (permalink / raw)
  To: zhong jiang; +Cc: davem, kvalo, pkshih, netdev, linux-kernel

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 <zhongjiang@huawei.com>
> ---
>  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))


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics
  2019-09-17  2:45   ` Jakub Kicinski
@ 2019-09-17  3:07     ` zhong jiang
  0 siblings, 0 replies; 7+ messages in thread
From: zhong jiang @ 2019-09-17  3:07 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, kvalo, pkshih, netdev, linux-kernel

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 <zhongjiang@huawei.com>
>> ---
>>  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))
>
> .
>



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-09-17  3:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04  3:46 [PATCH 0/3] net: remove an redundant continue zhong jiang
2019-09-04  3:46 ` [PATCH 1/3] rtlwifi: Remove an unnecessary continue in _rtl8723be_phy_config_bb_with_pgheaderfile zhong jiang
2019-09-04  3:46 ` [PATCH 2/3] nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics zhong jiang
2019-09-06 12:58   ` David Miller
2019-09-17  2:45   ` Jakub Kicinski
2019-09-17  3:07     ` zhong jiang
2019-09-04  3:46 ` [PATCH 3/3] ath10k: Drop unnecessary continue in ath10k_mac_update_vif_chan zhong jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).