* [PATCH v2 0/3] wireless: remove unneeded variable and return 0
@ 2019-11-01 12:33 zhong jiang
2019-11-01 12:33 ` [PATCH v2 1/3] ipw2x00: Remove redundant variable "rc" zhong jiang
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: zhong jiang @ 2019-11-01 12:33 UTC (permalink / raw)
To: kvalo, stas.yakovlev, simon.horman; +Cc: linux-wireless, netdev, zhongjiang
The issue is detected with help of coccinelle.
v1 -> v2:
libipw_qos_convert_ac_to_parameters() make it void.
zhong jiang (3):
ipw2x00: Remove redundant variable "rc"
iwlegacy: Remove redundant variable "ret"
b43legacy: ASoC: ux500: Remove redundant variable "count"
drivers/net/wireless/broadcom/b43legacy/debugfs.c | 9 +++------
drivers/net/wireless/intel/ipw2x00/libipw_rx.c | 4 +---
drivers/net/wireless/intel/iwlegacy/4965-mac.c | 3 +--
3 files changed, 5 insertions(+), 11 deletions(-)
--
1.7.12.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/3] ipw2x00: Remove redundant variable "rc"
2019-11-01 12:33 [PATCH v2 0/3] wireless: remove unneeded variable and return 0 zhong jiang
@ 2019-11-01 12:33 ` zhong jiang
2019-11-01 12:33 ` [PATCH v2 2/3] iwlegacy: Remove redundant variable "ret" zhong jiang
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: zhong jiang @ 2019-11-01 12:33 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 v2 2/3] iwlegacy: Remove redundant variable "ret"
2019-11-01 12:33 [PATCH v2 0/3] wireless: remove unneeded variable and return 0 zhong jiang
2019-11-01 12:33 ` [PATCH v2 1/3] ipw2x00: Remove redundant variable "rc" zhong jiang
@ 2019-11-01 12:33 ` zhong jiang
2019-11-01 12:33 ` [PATCH v2 3/3] b43legacy: ASoC: ux500: Remove redundant variable "count" zhong jiang
2019-11-01 13:44 ` [PATCH v2 0/3] wireless: remove unneeded variable and return 0 Simon Horman
3 siblings, 0 replies; 6+ messages in thread
From: zhong jiang @ 2019-11-01 12:33 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
* [PATCH v2 3/3] b43legacy: ASoC: ux500: Remove redundant variable "count"
2019-11-01 12:33 [PATCH v2 0/3] wireless: remove unneeded variable and return 0 zhong jiang
2019-11-01 12:33 ` [PATCH v2 1/3] ipw2x00: Remove redundant variable "rc" zhong jiang
2019-11-01 12:33 ` [PATCH v2 2/3] iwlegacy: Remove redundant variable "ret" zhong jiang
@ 2019-11-01 12:33 ` zhong jiang
2019-11-01 13:44 ` [PATCH v2 0/3] wireless: remove unneeded variable and return 0 Simon Horman
3 siblings, 0 replies; 6+ messages in thread
From: zhong jiang @ 2019-11-01 12:33 UTC (permalink / raw)
To: kvalo, stas.yakovlev, simon.horman; +Cc: linux-wireless, netdev, zhongjiang
local variable "count" is not used. hence it is safe to remove and
just return 0.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
drivers/net/wireless/broadcom/b43legacy/debugfs.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/broadcom/b43legacy/debugfs.c b/drivers/net/wireless/broadcom/b43legacy/debugfs.c
index 082aab8..de766c7 100644
--- a/drivers/net/wireless/broadcom/b43legacy/debugfs.c
+++ b/drivers/net/wireless/broadcom/b43legacy/debugfs.c
@@ -65,7 +65,6 @@ struct b43legacy_dfs_file * fops_to_dfs_file(struct b43legacy_wldev *dev,
/* wl->irq_lock is locked */
static ssize_t tsf_read_file(struct b43legacy_wldev *dev, char *buf, size_t bufsize)
{
- ssize_t count = 0;
u64 tsf;
b43legacy_tsf_read(dev, &tsf);
@@ -73,7 +72,7 @@ static ssize_t tsf_read_file(struct b43legacy_wldev *dev, char *buf, size_t bufs
(unsigned int)((tsf & 0xFFFFFFFF00000000ULL) >> 32),
(unsigned int)(tsf & 0xFFFFFFFFULL));
- return count;
+ return 0;
}
/* wl->irq_lock is locked */
@@ -91,7 +90,6 @@ static int tsf_write_file(struct b43legacy_wldev *dev, const char *buf, size_t c
/* wl->irq_lock is locked */
static ssize_t ucode_regs_read_file(struct b43legacy_wldev *dev, char *buf, size_t bufsize)
{
- ssize_t count = 0;
int i;
for (i = 0; i < 64; i++) {
@@ -99,7 +97,7 @@ static ssize_t ucode_regs_read_file(struct b43legacy_wldev *dev, char *buf, size
b43legacy_shm_read16(dev, B43legacy_SHM_WIRELESS, i));
}
- return count;
+ return 0;
}
/* wl->irq_lock is locked */
@@ -125,7 +123,6 @@ static ssize_t shm_read_file(struct b43legacy_wldev *dev, char *buf, size_t bufs
static ssize_t txstat_read_file(struct b43legacy_wldev *dev, char *buf, size_t bufsize)
{
struct b43legacy_txstatus_log *log = &dev->dfsentry->txstatlog;
- ssize_t count = 0;
unsigned long flags;
int i, idx;
struct b43legacy_txstatus *stat;
@@ -166,7 +163,7 @@ static ssize_t txstat_read_file(struct b43legacy_wldev *dev, char *buf, size_t b
out_unlock:
spin_unlock_irqrestore(&log->lock, flags);
- return count;
+ return 0;
}
/* wl->irq_lock is locked */
--
1.7.12.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 0/3] wireless: remove unneeded variable and return 0
2019-11-01 12:33 [PATCH v2 0/3] wireless: remove unneeded variable and return 0 zhong jiang
` (2 preceding siblings ...)
2019-11-01 12:33 ` [PATCH v2 3/3] b43legacy: ASoC: ux500: Remove redundant variable "count" zhong jiang
@ 2019-11-01 13:44 ` Simon Horman
2019-11-02 9:00 ` zhong jiang
3 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2019-11-01 13:44 UTC (permalink / raw)
To: zhong jiang; +Cc: kvalo, stas.yakovlev, linux-wireless, netdev
On Fri, Nov 01, 2019 at 08:33:38PM +0800, zhong jiang wrote:
> The issue is detected with help of coccinelle.
>
> v1 -> v2:
> libipw_qos_convert_ac_to_parameters() make it void.
Reviewed-by: Simon Horman <simon.horman@netronome.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 0/3] wireless: remove unneeded variable and return 0
2019-11-01 13:44 ` [PATCH v2 0/3] wireless: remove unneeded variable and return 0 Simon Horman
@ 2019-11-02 9:00 ` zhong jiang
0 siblings, 0 replies; 6+ messages in thread
From: zhong jiang @ 2019-11-02 9:00 UTC (permalink / raw)
To: Simon Horman; +Cc: kvalo, stas.yakovlev, linux-wireless, netdev
On 2019/11/1 21:44, Simon Horman wrote:
> On Fri, Nov 01, 2019 at 08:33:38PM +0800, zhong jiang wrote:
>> The issue is detected with help of coccinelle.
>>
>> v1 -> v2:
>> libipw_qos_convert_ac_to_parameters() make it void.
> Reviewed-by: Simon Horman <simon.horman@netronome.com>
I am sorry for that. [PATCH 3/3] is not correct. its local variable will be used by
fappend. hence just remove the patch in v3.
Thanks,
zhong jiang
> .
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-11-02 9:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-01 12:33 [PATCH v2 0/3] wireless: remove unneeded variable and return 0 zhong jiang
2019-11-01 12:33 ` [PATCH v2 1/3] ipw2x00: Remove redundant variable "rc" zhong jiang
2019-11-01 12:33 ` [PATCH v2 2/3] iwlegacy: Remove redundant variable "ret" zhong jiang
2019-11-01 12:33 ` [PATCH v2 3/3] b43legacy: ASoC: ux500: Remove redundant variable "count" zhong jiang
2019-11-01 13:44 ` [PATCH v2 0/3] wireless: remove unneeded variable and return 0 Simon Horman
2019-11-02 9:00 ` 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).