netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] wireless: remove unneeded variable and return 0
@ 2019-11-02  8:55 zhong jiang
  2019-11-02  8:55 ` [PATCH v3 1/2] ipw2x00: Remove redundant variable "rc" zhong jiang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: zhong jiang @ 2019-11-02  8:55 UTC (permalink / raw)
  To: kvalo, stas.yakovlev, simon.horman; +Cc: linux-wireless, netdev, zhongjiang

The issue is detected with help of coccinelle.

v2 -> v3:
    Remove [PATCH 3/3] of series. Because fappend will use the
    local variable.  

v1 -> v2:
    libipw_qos_convert_ac_to_parameters() make it void.

zhong jiang (2):
  ipw2x00: Remove redundant variable "rc"
  iwlegacy: Remove redundant variable "ret"

 drivers/net/wireless/intel/ipw2x00/libipw_rx.c | 4 +---
 drivers/net/wireless/intel/iwlegacy/4965-mac.c | 3 +--
 2 files changed, 2 insertions(+), 5 deletions(-)

-- 
1.7.12.4


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

* [PATCH v3 1/2] ipw2x00: Remove redundant variable "rc"
  2019-11-02  8:55 [PATCH v3 0/2] wireless: remove unneeded variable and return 0 zhong jiang
@ 2019-11-02  8:55 ` zhong jiang
  2019-11-06 17:53   ` Kalle Valo
  2019-11-02  8:55 ` [PATCH v3 2/2] iwlegacy: Remove redundant variable "ret" zhong jiang
  2019-11-04 16:20 ` [PATCH v3 0/2] wireless: remove unneeded variable and return 0 Kalle Valo
  2 siblings, 1 reply; 6+ messages in thread
From: zhong jiang @ 2019-11-02  8:55 UTC (permalink / raw)
  To: kvalo, stas.yakovlev, simon.horman; +Cc: linux-wireless, netdev, zhongjiang

local variable "rc" is not used. It is safe to remove and
There is only one caller of libipw_qos_convert_ac_to_parameters().
hence make it void

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 drivers/net/wireless/intel/ipw2x00/libipw_rx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_rx.c b/drivers/net/wireless/intel/ipw2x00/libipw_rx.c
index 34cfd81..0cb36d1 100644
--- a/drivers/net/wireless/intel/ipw2x00/libipw_rx.c
+++ b/drivers/net/wireless/intel/ipw2x00/libipw_rx.c
@@ -999,13 +999,12 @@ static int libipw_read_qos_info_element(struct
 /*
  * Write QoS parameters from the ac parameters.
  */
-static int libipw_qos_convert_ac_to_parameters(struct
+static void libipw_qos_convert_ac_to_parameters(struct
 						  libipw_qos_parameter_info
 						  *param_elm, struct
 						  libipw_qos_parameters
 						  *qos_param)
 {
-	int rc = 0;
 	int i;
 	struct libipw_qos_ac_parameter *ac_params;
 	u32 txop;
@@ -1030,7 +1029,6 @@ static int libipw_qos_convert_ac_to_parameters(struct
 		txop = le16_to_cpu(ac_params->tx_op_limit) * 32;
 		qos_param->tx_op_limit[i] = cpu_to_le16(txop);
 	}
-	return rc;
 }
 
 /*
-- 
1.7.12.4


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

* [PATCH v3 2/2] iwlegacy: Remove redundant variable "ret"
  2019-11-02  8:55 [PATCH v3 0/2] wireless: remove unneeded variable and return 0 zhong jiang
  2019-11-02  8:55 ` [PATCH v3 1/2] ipw2x00: Remove redundant variable "rc" zhong jiang
@ 2019-11-02  8:55 ` zhong jiang
  2019-11-04 16:20 ` [PATCH v3 0/2] wireless: remove unneeded variable and return 0 Kalle Valo
  2 siblings, 0 replies; 6+ messages in thread
From: zhong jiang @ 2019-11-02  8:55 UTC (permalink / raw)
  To: kvalo, stas.yakovlev, simon.horman; +Cc: linux-wireless, netdev, zhongjiang

local variable "ret" is not used. hence it is safe to remove and
just return 0.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 drivers/net/wireless/intel/iwlegacy/4965-mac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
index 51fdd7c..3664f56 100644
--- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
@@ -3331,7 +3331,6 @@ struct il_mod_params il4965_mod_params = {
 				 struct ieee80211_key_conf *keyconf, u8 sta_id)
 {
 	unsigned long flags;
-	int ret = 0;
 	__le16 key_flags = 0;
 
 	key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK);
@@ -3368,7 +3367,7 @@ struct il_mod_params il4965_mod_params = {
 
 	spin_unlock_irqrestore(&il->sta_lock, flags);
 
-	return ret;
+	return 0;
 }
 
 void
-- 
1.7.12.4


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

* Re: [PATCH v3 0/2] wireless: remove unneeded variable and return 0
  2019-11-02  8:55 [PATCH v3 0/2] wireless: remove unneeded variable and return 0 zhong jiang
  2019-11-02  8:55 ` [PATCH v3 1/2] ipw2x00: Remove redundant variable "rc" zhong jiang
  2019-11-02  8:55 ` [PATCH v3 2/2] iwlegacy: Remove redundant variable "ret" zhong jiang
@ 2019-11-04 16:20 ` Kalle Valo
  2019-11-05 12:32   ` zhong jiang
  2 siblings, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2019-11-04 16:20 UTC (permalink / raw)
  To: zhong jiang; +Cc: stas.yakovlev, simon.horman, linux-wireless, netdev

zhong jiang <zhongjiang@huawei.com> writes:

> The issue is detected with help of coccinelle.
>
> v2 -> v3:
>     Remove [PATCH 3/3] of series. Because fappend will use the
>     local variable.  

You really need to test your patches. If you submit patches without
build testing I'm not going to take such patches.

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

* Re: [PATCH v3 0/2] wireless: remove unneeded variable and return 0
  2019-11-04 16:20 ` [PATCH v3 0/2] wireless: remove unneeded variable and return 0 Kalle Valo
@ 2019-11-05 12:32   ` zhong jiang
  0 siblings, 0 replies; 6+ messages in thread
From: zhong jiang @ 2019-11-05 12:32 UTC (permalink / raw)
  To: Kalle Valo; +Cc: stas.yakovlev, simon.horman, linux-wireless, netdev

On 2019/11/5 0:20, Kalle Valo wrote:
> zhong jiang <zhongjiang@huawei.com> writes:
>
>> The issue is detected with help of coccinelle.
>>
>> v2 -> v3:
>>     Remove [PATCH 3/3] of series. Because fappend will use the
>>     local variable.  
> You really need to test your patches. If you submit patches without
> build testing I'm not going to take such patches.
>
I am sorry for that. :-[

Thanks,
zhong jiang


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

* Re: [PATCH v3 1/2] ipw2x00: Remove redundant variable "rc"
  2019-11-02  8:55 ` [PATCH v3 1/2] ipw2x00: Remove redundant variable "rc" zhong jiang
@ 2019-11-06 17:53   ` Kalle Valo
  0 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2019-11-06 17:53 UTC (permalink / raw)
  To: zhong jiang
  Cc: stas.yakovlev, simon.horman, linux-wireless, netdev, zhongjiang

zhong jiang <zhongjiang@huawei.com> wrote:

> local variable "rc" is not used. It is safe to remove and
> There is only one caller of libipw_qos_convert_ac_to_parameters().
> hence make it void
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>

2 patches applied to wireless-drivers-next.git, thanks.

e310813279b7 ipw2x00: Remove redundant variable "rc"
ea7ad5f12ca2 iwlegacy: Remove redundant variable "ret"

-- 
https://patchwork.kernel.org/patch/11224069/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, other threads:[~2019-11-06 17:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-02  8:55 [PATCH v3 0/2] wireless: remove unneeded variable and return 0 zhong jiang
2019-11-02  8:55 ` [PATCH v3 1/2] ipw2x00: Remove redundant variable "rc" zhong jiang
2019-11-06 17:53   ` Kalle Valo
2019-11-02  8:55 ` [PATCH v3 2/2] iwlegacy: Remove redundant variable "ret" zhong jiang
2019-11-04 16:20 ` [PATCH v3 0/2] wireless: remove unneeded variable and return 0 Kalle Valo
2019-11-05 12:32   ` 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).