2019-11-02 09:01:09

by zhong jiang

[permalink] [raw]
Subject: [PATCH v3 0/2] wireless: remove unneeded variable and return 0

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


2019-11-02 09:02:13

by zhong jiang

[permalink] [raw]
Subject: [PATCH v3 1/2] ipw2x00: Remove redundant variable "rc"

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 <[email protected]>
---
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

2019-11-02 09:02:25

by zhong jiang

[permalink] [raw]
Subject: [PATCH v3 2/2] iwlegacy: Remove redundant variable "ret"

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

Signed-off-by: zhong jiang <[email protected]>
---
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

2019-11-04 16:21:50

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] wireless: remove unneeded variable and return 0

zhong jiang <[email protected]> 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

2019-11-05 12:36:14

by zhong jiang

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] wireless: remove unneeded variable and return 0

On 2019/11/5 0:20, Kalle Valo wrote:
> zhong jiang <[email protected]> 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

2019-11-06 17:54:57

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v3 1/2] ipw2x00: Remove redundant variable "rc"

zhong jiang <[email protected]> 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 <[email protected]>

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