2015-10-27 19:03:24

by punit vara

[permalink] [raw]
Subject: [RESEND PATCH 01/10] net: wireless: ath: Remove unnecessary semicolon

This patch is to the htt_rx.c that removes unneeded semicolon which is
reported by coccicheck.

Here semicolon just create empty statement so please remote it.

Signed-off-by: Punit Vara <[email protected]>
---
drivers/net/wireless/ath/ath10k/htt_rx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 1b7a043..002a633 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -2077,7 +2077,7 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
ath10k_dbg_dump(ar, ATH10K_DBG_HTT_DUMP, NULL, "htt event: ",
skb->data, skb->len);
break;
- };
+ }

/* Free the indication buffer */
dev_kfree_skb_any(skb);
--
2.5.3



2015-10-27 19:04:34

by punit vara

[permalink] [raw]
Subject: [RESEND PATCH 10/10] net: wireless: ath: Remove unneeded variable ret returning 0

This patch is to the ath5k/eeprom.c that fixes up warning caught by
coccicheck:

-Unneeded variable: "ret". Return "0" on line 1733

Remove unneccesary variable ret created to return zero.

Signed-off-by: Punit Vara <[email protected]>
---
drivers/net/wireless/ath/ath5k/eeprom.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c
index 94d34ee..673ab8d 100644
--- a/drivers/net/wireless/ath/ath5k/eeprom.c
+++ b/drivers/net/wireless/ath/ath5k/eeprom.c
@@ -1707,7 +1707,7 @@ ath5k_eeprom_read_spur_chans(struct ath5k_hw *ah)
struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
u32 offset;
u16 val;
- int ret = 0, i;
+ int i;

offset = AR5K_EEPROM_CTL(ee->ee_version) +
AR5K_EEPROM_N_CTLS(ee->ee_version);
@@ -1730,7 +1730,7 @@ ath5k_eeprom_read_spur_chans(struct ath5k_hw *ah)
}
}

- return ret;
+ return 0;
}


--
2.5.3


2015-10-27 19:04:28

by punit vara

[permalink] [raw]
Subject: [RESEND PATCH 09/10] net: wireless: brcm80211: Remove unneeded variable ret_code returning 0

This patch is to the brcmsmac/stf.c that fixes up warning caught by
coccicheck:

-Unneeded variable: "ret_code". Return "0" on line 328

Remove unneccesary variable ret_code created to return zero.

Signed-off-by: Punit Vara <[email protected]>
---
drivers/net/wireless/brcm80211/brcmsmac/stf.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/stf.c b/drivers/net/wireless/brcm80211/brcmsmac/stf.c
index dd91627..71ddf42 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/stf.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/stf.c
@@ -306,7 +306,6 @@ int brcms_c_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val, bool force)
*/
int brcms_c_stf_ss_update(struct brcms_c_info *wlc, struct brcms_band *band)
{
- int ret_code = 0;
u8 prev_stf_ss;
u8 upd_stf_ss;

@@ -325,7 +324,7 @@ int brcms_c_stf_ss_update(struct brcms_c_info *wlc, struct brcms_band *band)
PHY_TXC1_MODE_SISO : PHY_TXC1_MODE_CDD;
} else {
if (wlc->band != band)
- return ret_code;
+ return 0;
upd_stf_ss = (wlc->stf->txstreams == 1) ?
PHY_TXC1_MODE_SISO : band->band_stf_ss_mode;
}
@@ -334,7 +333,7 @@ int brcms_c_stf_ss_update(struct brcms_c_info *wlc, struct brcms_band *band)
brcms_b_band_stf_ss_set(wlc->hw, upd_stf_ss);
}

- return ret_code;
+ return 0;
}

int brcms_c_stf_attach(struct brcms_c_info *wlc)
--
2.5.3


2015-10-28 13:36:32

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [RESEND PATCH 07/10] net: wireless: iwlegacy: Remove unneeded variable ret

On 10/28/2015 4:35 PM, Sergei Shtylyov wrote:

>> This patch is to the 3945-mac.c file that fixes up following warning
>> by coccicheck:
>>
>> drivers/net/wireless/iwlegacy/3945-mac.c:247:5-8: Unneeded variable:
>> "ret". Return "- EOPNOTSUPP" on line 249
>>
>> Return -EOPNOTSUPP directly instead of return using ret
>>
>> Signed-off-by: Punit Vara <[email protected]>
>> ---
>> drivers/net/wireless/iwlegacy/3945-mac.c | 5 +----
>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c
>> b/drivers/net/wireless/iwlegacy/3945-mac.c
>> index af1b3e6..ff4dc44 100644
>> --- a/drivers/net/wireless/iwlegacy/3945-mac.c
>> +++ b/drivers/net/wireless/iwlegacy/3945-mac.c
>> @@ -244,9 +244,7 @@ il3945_set_dynamic_key(struct il_priv *il, struct
>> ieee80211_key_conf *keyconf,
>> static int
>> il3945_remove_static_key(struct il_priv *il)
>> {
>> - int ret = -EOPNOTSUPP;
>> -
>> - return ret;
>> + return -EOPNOTSUPP;
>> }
>>
>> static int
>> @@ -529,7 +527,6 @@ il3945_tx_skb(struct il_priv *il,
>> if (unlikely(tid >= MAX_TID_COUNT))
>> goto drop;
>> }
>> -
>
> Unrelated white space change.

And I've already complained about it! Please remove this hunk.

MBR, Sergei


2015-10-27 19:03:32

by punit vara

[permalink] [raw]
Subject: [RESEND PATCH 02/10] net: wireless: ath: Remove unnecessary semicolon

This patch is to the ath10k/wmi.h that removes unneeded semicolon which
is reported by coccicheck.

Here semicolon just create empty statement so please remote it.

Signed-off-by: Punit Vara <[email protected]>
---
drivers/net/wireless/ath/ath10k/wmi.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 52d3503..21d5b6b 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -1675,7 +1675,7 @@ static inline const char *ath10k_wmi_phymode_str(enum wmi_phy_mode mode)

/* no default handler to allow compiler to check that the
* enum is fully handled */
- };
+ }

return "<unknown>";
}
--
2.5.3


2015-10-27 19:03:51

by punit vara

[permalink] [raw]
Subject: [RESEND PATCH 03/10] net: wireless: rtwifi: Remove duplicated arguments to |

Remove uncessary repeated arguments COMP_EFUSE, COMP_REGD, COMP_CHAN
with OR(|)

This is patch to the debug.c file that removes following warning
reported by coccicheck:

-duplicated argument to & or |

Signed-off-by: Punit Vara <[email protected]>
---
drivers/net/wireless/rtlwifi/debug.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/debug.c b/drivers/net/wireless/rtlwifi/debug.c
index fd25aba..b8f5540 100644
--- a/drivers/net/wireless/rtlwifi/debug.c
+++ b/drivers/net/wireless/rtlwifi/debug.c
@@ -37,9 +37,9 @@ void rtl_dbgp_flag_init(struct ieee80211_hw *hw)
COMP_BEACON | COMP_RATE | COMP_RXDESC | COMP_DIG | COMP_TXAGC |
COMP_POWER | COMP_POWER_TRACKING | COMP_BB_POWERSAVING | COMP_SWAS |
COMP_RF | COMP_TURBO | COMP_RATR | COMP_CMD |
- COMP_EFUSE | COMP_QOS | COMP_MAC80211 | COMP_REGD | COMP_CHAN |
- COMP_EASY_CONCURRENT | COMP_EFUSE | COMP_QOS | COMP_MAC80211 |
- COMP_REGD | COMP_CHAN | COMP_BT_COEXIST;
+ COMP_EFUSE | COMP_QOS | COMP_MAC80211 | COMP_CHAN |
+ COMP_EASY_CONCURRENT | COMP_QOS | COMP_MAC80211 |
+ COMP_REGD | COMP_BT_COEXIST;


for (i = 0; i < DBGP_TYPE_MAX; i++)
--
2.5.3


2015-10-27 19:04:23

by punit vara

[permalink] [raw]
Subject: [RESEND PATCH 08/10] net: wireless: brcm80211: Remove unneeded variable which return 0

This is patch to the brcmsmac/main.c that removes unnecessary variable
which was declared to return zero.

This patch fixes up warning reported by coccicheck:
-Unneeded variable: "err". Return "0" on line 3788

Signed-off-by: Punit Vara <[email protected]>
---
drivers/net/wireless/brcm80211/brcmsmac/main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 9728be0..9d717b6 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -3777,7 +3777,6 @@ static void brcms_c_set_ps_ctrl(struct brcms_c_info *wlc)
*/
static int brcms_c_set_mac(struct brcms_bss_cfg *bsscfg)
{
- int err = 0;
struct brcms_c_info *wlc = bsscfg->wlc;

/* enter the MAC addr into the RXE match registers */
@@ -3785,7 +3784,7 @@ static int brcms_c_set_mac(struct brcms_bss_cfg *bsscfg)

brcms_c_ampdu_macaddr_upd(wlc);

- return err;
+ return 0;
}

/* Write the BSS config's BSSID address to core (set_bssid in d11procs.tcl).
--
2.5.3


2015-10-27 19:03:58

by punit vara

[permalink] [raw]
Subject: [RESEND PATCH 04/10] net: wireless: brcm80211: Remove duplicated arguments to |

Remove uncessary repeated arguments with OR(|)

This is patch to the brcmsmac/channel.c file that removes following
warning reported by coccicheck:

-duplicated argument to & or |

Signed-off-by: Punit Vara <[email protected]>
---
drivers/net/wireless/brcm80211/brcmsmac/channel.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
index 635ae03..d56fa03 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
@@ -652,7 +652,6 @@ static void brcms_reg_apply_radar_flags(struct wiphy *wiphy)
*/
if (!(ch->flags & IEEE80211_CHAN_DISABLED))
ch->flags |= IEEE80211_CHAN_RADAR |
- IEEE80211_CHAN_NO_IR |
IEEE80211_CHAN_NO_IR;
}
}
--
2.5.3


2015-10-27 19:04:15

by punit vara

[permalink] [raw]
Subject: [RESEND PATCH 07/10] net: wireless: iwlegacy: Remove unneeded variable ret

This patch is to the 3945-mac.c file that fixes up following warning
by coccicheck:

drivers/net/wireless/iwlegacy/3945-mac.c:247:5-8: Unneeded variable:
"ret". Return "- EOPNOTSUPP" on line 249

Return -EOPNOTSUPP directly instead of return using ret

Signed-off-by: Punit Vara <[email protected]>
---
drivers/net/wireless/iwlegacy/3945-mac.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index af1b3e6..ff4dc44 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -244,9 +244,7 @@ il3945_set_dynamic_key(struct il_priv *il, struct ieee80211_key_conf *keyconf,
static int
il3945_remove_static_key(struct il_priv *il)
{
- int ret = -EOPNOTSUPP;
-
- return ret;
+ return -EOPNOTSUPP;
}

static int
@@ -529,7 +527,6 @@ il3945_tx_skb(struct il_priv *il,
if (unlikely(tid >= MAX_TID_COUNT))
goto drop;
}
-
/* Descriptor for chosen Tx queue */
txq = &il->txq[txq_id];
q = &txq->q;
--
2.5.3


2015-10-27 19:04:04

by punit vara

[permalink] [raw]
Subject: [RESEND PATCH 05/10] net: wireless: simplify return flow for zd1201_setconfig16

This patch is to the zd1201.c file that fixes up warning
reported by coccicheck:

WARNING: end returns can be simplified and declaration on line 1658 can
be dropped

Prefer direct return value instead of writing 2-3 more sentence.

Signed-off-by: Punit Vara <[email protected]>
---
drivers/net/wireless/zd1201.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c
index 6f5c793..d9e67d9 100644
--- a/drivers/net/wireless/zd1201.c
+++ b/drivers/net/wireless/zd1201.c
@@ -1655,15 +1655,11 @@ static int zd1201_set_maxassoc(struct net_device *dev,
struct iw_request_info *info, struct iw_param *rrq, char *extra)
{
struct zd1201 *zd = netdev_priv(dev);
- int err;

if (!zd->ap)
return -EOPNOTSUPP;

- err = zd1201_setconfig16(zd, ZD1201_RID_CNFMAXASSOCSTATIONS, rrq->value);
- if (err)
- return err;
- return 0;
+ return zd1201_setconfig16(zd, ZD1201_RID_CNFMAXASSOCSTATIONS, rrq->value);
}

static int zd1201_get_maxassoc(struct net_device *dev,
--
2.5.3


2015-10-27 19:04:10

by punit vara

[permalink] [raw]
Subject: [RESEND PATCH 06/10] net: wireless: ath: simplify return flow for carl9170_regwrite_result()

This patch is to the carl9170/phy.c file that fixes warning reported by
coccicheck :

WARNING: end returns can be simplified

I have removed unneccessary variable declaration and simply return flow
for carl9170_regwrite_result()

Signed-off-by: Punit Vara <[email protected]>
---
drivers/net/wireless/ath/carl9170/phy.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/carl9170/phy.c b/drivers/net/wireless/ath/carl9170/phy.c
index dca6df1..f3b5434 100644
--- a/drivers/net/wireless/ath/carl9170/phy.c
+++ b/drivers/net/wireless/ath/carl9170/phy.c
@@ -966,7 +966,6 @@ static const struct carl9170_phy_freq_entry carl9170_phy_freq_params[] = {
static int carl9170_init_rf_bank4_pwr(struct ar9170 *ar, bool band5ghz,
u32 freq, enum carl9170_bw bw)
{
- int err;
u32 d0, d1, td0, td1, fd0, fd1;
u8 chansel;
u8 refsel0 = 1, refsel1 = 0;
@@ -1024,11 +1023,7 @@ static int carl9170_init_rf_bank4_pwr(struct ar9170 *ar, bool band5ghz,
carl9170_regwrite(0x1c58e8, fd1);

carl9170_regwrite_finish();
- err = carl9170_regwrite_result();
- if (err)
- return err;
-
- return 0;
+ return carl9170_regwrite_result();
}

static const struct carl9170_phy_freq_params *
--
2.5.3


2015-10-28 13:35:16

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [RESEND PATCH 07/10] net: wireless: iwlegacy: Remove unneeded variable ret

Hello.

On 10/27/2015 10:02 PM, Punit Vara wrote:

> This patch is to the 3945-mac.c file that fixes up following warning
> by coccicheck:
>
> drivers/net/wireless/iwlegacy/3945-mac.c:247:5-8: Unneeded variable:
> "ret". Return "- EOPNOTSUPP" on line 249
>
> Return -EOPNOTSUPP directly instead of return using ret
>
> Signed-off-by: Punit Vara <[email protected]>
> ---
> drivers/net/wireless/iwlegacy/3945-mac.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
> index af1b3e6..ff4dc44 100644
> --- a/drivers/net/wireless/iwlegacy/3945-mac.c
> +++ b/drivers/net/wireless/iwlegacy/3945-mac.c
> @@ -244,9 +244,7 @@ il3945_set_dynamic_key(struct il_priv *il, struct ieee80211_key_conf *keyconf,
> static int
> il3945_remove_static_key(struct il_priv *il)
> {
> - int ret = -EOPNOTSUPP;
> -
> - return ret;
> + return -EOPNOTSUPP;
> }
>
> static int
> @@ -529,7 +527,6 @@ il3945_tx_skb(struct il_priv *il,
> if (unlikely(tid >= MAX_TID_COUNT))
> goto drop;
> }
> -

Unrelated white space change.

MBR, Sergei


2016-02-02 16:42:28

by Sudip Mukherjee

[permalink] [raw]
Subject: Re: [RESEND,01/10] net: wireless: ath: Remove unnecessary semicolon

On Wed, Oct 28, 2015 at 12:32:36AM +0530, punit vara wrote:
> This patch is to the htt_rx.c that removes unneeded semicolon which is
> reported by coccicheck.
>
> Here semicolon just create empty statement so please remote it.

s/remote/remove

Instead of "net: wireless: ath: Remove unnecessary semicolon" the subject
should be "ath10k: Remove unnecessary semicolon"

and please combine this patch and the next patch as they are similar
change to the same driver.

regards
sudip