All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723au: core: rtw_mlme: Removed variables that is never used
@ 2015-01-31 14:58 Rickard Strandqvist
  2015-02-01 23:02 ` Jes Sorensen
  0 siblings, 1 reply; 3+ messages in thread
From: Rickard Strandqvist @ 2015-01-31 14:58 UTC (permalink / raw)
  To: Larry Finger, Jes Sorensen
  Cc: Rickard Strandqvist, Greg Kroah-Hartman, linux-wireless, devel,
	linux-kernel

Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/staging/rtl8723au/core/rtw_mlme.c |   21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c
index 7299ef0..8b2db4b 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme.c
@@ -2123,7 +2123,6 @@ bool rtw_restructure_ht_ie23a(struct rtw_adapter *padapter, u8 *in_ie,
 {
 	u32 out_len;
 	int max_rx_ampdu_factor;
-	unsigned char *pframe;
 	const u8 *p;
 	struct ieee80211_ht_cap ht_capie;
 	u8 WMM_IE[7] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00};
@@ -2139,10 +2138,10 @@ bool rtw_restructure_ht_ie23a(struct rtw_adapter *padapter, u8 *in_ie,
 
 		if (pmlmepriv->qos_option == 0) {
 			out_len = *pout_len;
-			pframe = rtw_set_ie23a(out_ie + out_len,
-					       WLAN_EID_VENDOR_SPECIFIC,
-					       sizeof(WMM_IE), WMM_IE,
-					       pout_len);
+			rtw_set_ie23a(out_ie + out_len,
+						WLAN_EID_VENDOR_SPECIFIC,
+						sizeof(WMM_IE), WMM_IE,
+						pout_len);
 
 			pmlmepriv->qos_option = 1;
 		}
@@ -2172,18 +2171,18 @@ bool rtw_restructure_ht_ie23a(struct rtw_adapter *padapter, u8 *in_ie,
 			ht_capie.ampdu_params_info |=
 				(IEEE80211_HT_AMPDU_PARM_DENSITY & 0x00);
 
-		pframe = rtw_set_ie23a(out_ie + out_len, WLAN_EID_HT_CAPABILITY,
-				    sizeof(struct ieee80211_ht_cap),
-				    (unsigned char *)&ht_capie, pout_len);
+		rtw_set_ie23a(out_ie + out_len, WLAN_EID_HT_CAPABILITY,
+				sizeof(struct ieee80211_ht_cap),
+				(unsigned char *)&ht_capie, pout_len);
 
 		phtpriv->ht_option = true;
 
 		p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, in_ie, in_len);
 		if (p && (p[1] == sizeof(struct ieee80211_ht_operation))) {
 			out_len = *pout_len;
-			pframe = rtw_set_ie23a(out_ie + out_len,
-					       WLAN_EID_HT_OPERATION,
-					       p[1], p + 2 , pout_len);
+			rtw_set_ie23a(out_ie + out_len,
+					WLAN_EID_HT_OPERATION,
+					p[1], p + 2, pout_len);
 		}
 	}
 
-- 
1.7.10.4


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

* Re: [PATCH] staging: rtl8723au: core: rtw_mlme: Removed variables that is never used
  2015-01-31 14:58 [PATCH] staging: rtl8723au: core: rtw_mlme: Removed variables that is never used Rickard Strandqvist
@ 2015-02-01 23:02 ` Jes Sorensen
  2015-02-01 23:18   ` Rickard Strandqvist
  0 siblings, 1 reply; 3+ messages in thread
From: Jes Sorensen @ 2015-02-01 23:02 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Larry Finger, Greg Kroah-Hartman, linux-wireless, devel, linux-kernel

Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> writes:
> Variable was assigned a value that was never used.
> I have also removed all the code that thereby serves no purpose.
>
> This was found using a static code analysis program called cppcheck
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  drivers/staging/rtl8723au/core/rtw_mlme.c |   21 ++++++++++-----------
>  1 file changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c
> index 7299ef0..8b2db4b 100644
> --- a/drivers/staging/rtl8723au/core/rtw_mlme.c
> +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c
> @@ -2123,7 +2123,6 @@ bool rtw_restructure_ht_ie23a(struct rtw_adapter *padapter, u8 *in_ie,
>  {
>  	u32 out_len;
>  	int max_rx_ampdu_factor;
> -	unsigned char *pframe;
>  	const u8 *p;
>  	struct ieee80211_ht_cap ht_capie;
>  	u8 WMM_IE[7] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00};
> @@ -2139,10 +2138,10 @@ bool rtw_restructure_ht_ie23a(struct rtw_adapter *padapter, u8 *in_ie,
>  
>  		if (pmlmepriv->qos_option == 0) {
>  			out_len = *pout_len;
> -			pframe = rtw_set_ie23a(out_ie + out_len,
> -					       WLAN_EID_VENDOR_SPECIFIC,
> -					       sizeof(WMM_IE), WMM_IE,
> -					       pout_len);
> +			rtw_set_ie23a(out_ie + out_len,
> +						WLAN_EID_VENDOR_SPECIFIC,
> +						sizeof(WMM_IE), WMM_IE,
> +						pout_len);

And again here - do it properly, please.

Jes

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

* Re: [PATCH] staging: rtl8723au: core: rtw_mlme: Removed variables that is never used
  2015-02-01 23:02 ` Jes Sorensen
@ 2015-02-01 23:18   ` Rickard Strandqvist
  0 siblings, 0 replies; 3+ messages in thread
From: Rickard Strandqvist @ 2015-02-01 23:18 UTC (permalink / raw)
  To: Jes Sorensen
  Cc: Larry Finger, Greg Kroah-Hartman, linux-wireless, devel,
	Linux Kernel Mailing List

2015-02-02 0:02 GMT+01:00 Jes Sorensen <Jes.Sorensen@redhat.com>:
> Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> writes:
>> Variable was assigned a value that was never used.
>> I have also removed all the code that thereby serves no purpose.
>>
>> This was found using a static code analysis program called cppcheck
>>
>> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
>> ---
>>  drivers/staging/rtl8723au/core/rtw_mlme.c |   21 ++++++++++-----------
>>  1 file changed, 10 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c
>> index 7299ef0..8b2db4b 100644
>> --- a/drivers/staging/rtl8723au/core/rtw_mlme.c
>> +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c
>> @@ -2123,7 +2123,6 @@ bool rtw_restructure_ht_ie23a(struct rtw_adapter *padapter, u8 *in_ie,
>>  {
>>       u32 out_len;
>>       int max_rx_ampdu_factor;
>> -     unsigned char *pframe;
>>       const u8 *p;
>>       struct ieee80211_ht_cap ht_capie;
>>       u8 WMM_IE[7] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00};
>> @@ -2139,10 +2138,10 @@ bool rtw_restructure_ht_ie23a(struct rtw_adapter *padapter, u8 *in_ie,
>>
>>               if (pmlmepriv->qos_option == 0) {
>>                       out_len = *pout_len;
>> -                     pframe = rtw_set_ie23a(out_ie + out_len,
>> -                                            WLAN_EID_VENDOR_SPECIFIC,
>> -                                            sizeof(WMM_IE), WMM_IE,
>> -                                            pout_len);
>> +                     rtw_set_ie23a(out_ie + out_len,
>> +                                             WLAN_EID_VENDOR_SPECIFIC,
>> +                                             sizeof(WMM_IE), WMM_IE,
>> +                                             pout_len);
>
> And again here - do it properly, please.
>
> Jes

Hi Jes

I am sorry, please ignore this.
I will not send any more patches.

Kind regards
Rickard Strandqvist

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

end of thread, other threads:[~2015-02-01 23:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-31 14:58 [PATCH] staging: rtl8723au: core: rtw_mlme: Removed variables that is never used Rickard Strandqvist
2015-02-01 23:02 ` Jes Sorensen
2015-02-01 23:18   ` Rickard Strandqvist

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.