Staging: rtl8188eu: Remove redundant local variable
PATCH 1/3 Staging: rtl8188eu: Remove redundant local variable
This patch removes a redundant variable "raid" and adds inline return statements.
This issue is identified by the following coccinelle script:
@@
expression ret;
identifier f;
@@
-ret =
+return
f(...);
-return ret;
Signed-off-by Somya Anand <[email protected]>
--- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-)
drivers/staging/rtl8188eu/core/rtw_wlan_util.c +7 -17
@@ -88,35 +88,25 @@ int cckratesonly_included(unsigned char *rate, int ratelen)unsigned char networktype_to_raid (unsigned char network_type) { -unsigned char raid; -switch (network_type) {case WIRELESS_11B : - raid =RATR_INX_WIRELESS_B ; -break ; +return RATR_INX_WIRELESS_B ;case WIRELESS_11A :case WIRELESS_11G : - raid =RATR_INX_WIRELESS_G ; -break ; +return RATR_INX_WIRELESS_G ;case WIRELESS_11BG : - raid =RATR_INX_WIRELESS_GB ; -break ; +return RATR_INX_WIRELESS_GB ;case WIRELESS_11_24N :case WIRELESS_11_5N : - raid =RATR_INX_WIRELESS_N ; -break ; +return RATR_INX_WIRELESS_N ;case WIRELESS_11A_5N :case WIRELESS_11G_24N : - raid =RATR_INX_WIRELESS_NG ; -break ; +return RATR_INX_WIRELESS_NG ;case WIRELESS_11BG_24N : - raid =RATR_INX_WIRELESS_NGB ; -break ; +return RATR_INX_WIRELESS_NGB ;default : - raid =RATR_INX_WIRELESS_GB ; -break ; +return RATR_INX_WIRELESS_GB ; } -return raid; }u8 judge_network_type (struct adapter *padapter,unsigned char *rate,int ratelen)
Signature · 1 line
1.9.1
PATCH 2/3 Staging: rtl8188eu: Add blank line after declaration
This patch fixes checkpatch.pl warning by adding a blank line after declaration for better readability.
Signed-off-by Somya Anand <[email protected]>
--- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/staging/rtl8188eu/core/rtw_wlan_util.c +5 -1
@@ -101,7 +101,7 @@ unsigned char networktype_to_raid(unsigned char network_type)return RATR_INX_WIRELESS_N ;case WIRELESS_11A_5N :case WIRELESS_11G_24N : -return RATR_INX_WIRELESS_NG ; +return RATR_INX_WIRELESS_NG ;case WIRELESS_11BG_24N :return RATR_INX_WIRELESS_NGB ;default :
@@ -398,6 +398,7 @@ int get_bsstype(unsigned short capability)u16 get_beacon_interval (struct wlan_bssid_ex *bss) {__le16 val; +memcpy ((unsigned char *)&val,rtw_get_beacon_interval_from_ie (bss->IEs),2 );return le16_to_cpu (val);
@@ -1212,6 +1213,7 @@ unsigned int is_ap_in_wep(struct adapter *padapter)static int wifirate2_ratetbl_inx (unsigned char rate) {int inx =0 ; + rate = rate &0x7f ;switch (rate) {
@@ -1344,6 +1346,7 @@ void set_sta_rate(struct adapter *padapter, struct sta_info *psta)void update_tx_basic_rate (struct adapter *padapter,u8 wirelessmode) {unsigned char supported_rates[NDIS_802_11_LENGTH_RATES_EX ]; +memset (supported_rates,0 ,NDIS_802_11_LENGTH_RATES_EX );if ((wirelessmode &WIRELESS_11B ) && (wirelessmode ==WIRELESS_11B ))
@@ -1368,6 +1371,7 @@ unsigned char check_assoc_AP(u8 *pframe, uint len)struct ndis_802_11_var_ie *pIE;u8 epigram_vendor_flag;u8 ralink_vendor_flag; + epigram_vendor_flag =0 ; ralink_vendor_flag =0 ;
Signature · 1 line
1.9.1
PATCH 3/3 Staging: rtl8188eu: Remove unnecessary return statements
In reply to Somya AnandThis patch removes unnecessary return statement from a void function.
This issue is identified by checkpatch.pl
Signed-off-by Somya Anand <[email protected]>
--- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 2 -- 1 file changed, 2 deletions(-)
drivers/staging/rtl8188eu/core/rtw_wlan_util.c +0 -2
@@ -650,8 +650,6 @@ void WMMOnAssocRsp(struct adapter *padapter) pxmitpriv->wmm_para_seq[i] = inx[i];DBG_88E ("wmm_para_seq(%d): %d\n" , i, pxmitpriv->wmm_para_seq[i]); } - -return ; }static void bwmode_update_check (struct adapter *padapter,struct ndis_802_11_var_ie *pIE)
Signature · 1 line
1.9.1