staging: rtl8723bs: Fix indentation in conditional statements
PATCH 1/1 staging: rtl8723bs: Fix indentation in conditional statements
Remove/add tabs in block statements in rtl8723bs/core to fix checkpatch warnings for suspect code indent for conditionals.
--- drivers/staging/rtl8723bs/core/rtw_mlme.c | 30 +++++++++---------- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 +- drivers/staging/rtl8723bs/core/rtw_recv.c | 6 ++-- drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 2 +- 4 files changed, 19 insertions(+), 21 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme.c +14 -16
@@ -389,7 +389,7 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 fea__le16 tmps, tmpd;if (rtw_bug_check (dst, src, &s_cap, &d_cap) == false) -return false; +return false;memcpy ((u8 *)&tmps,rtw_get_capability_from_ie (src->ies),2 );memcpy ((u8 *)&tmpd,rtw_get_capability_from_ie (dst->ies),2 );
@@ -669,7 +669,7 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetworuint ie_len =0 ;if ((desired_encmode == Ndis802_11EncryptionDisabled) && (privacy !=0 )) - bselected = false; + bselected = false;if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) { p =rtw_get_ie (pnetwork->network.ies + _BEACON_IE_OFFSET_,WLAN_EID_RSN , &ie_len, (pnetwork->network.ie_length - _BEACON_IE_OFFSET_));
@@ -795,7 +795,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) pmlmepriv->to_join = false; s_ret =rtw_select_and_join_from_scanned_queue (pmlmepriv);if (s_ret == _SUCCESS) { -_set_timer (&pmlmepriv->assoc_timer,MAX_JOIN_TIMEOUT ); +_set_timer (&pmlmepriv->assoc_timer,MAX_JOIN_TIMEOUT ); }else if (s_ret ==2 ) {/* there is no need to wait for join */ _clr_fwstate_ (pmlmepriv, _FW_UNDER_LINKING);rtw_indicate_connect (adapter);
@@ -2010,8 +2010,8 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_if (in_ie[i] ==0xDD && in_ie[i+2 ] ==0x00 && in_ie[i+3 ] ==0x50 && in_ie[i+4 ] ==0xF2 && in_ie[i+5 ] ==0x02 && i+5 < in_len) {/* WMM element ID and OUI */ for (j = i; j < i +9 ; j++) { - out_ie[ielength] = in_ie[j]; - ielength++; + out_ie[ielength] = in_ie[j]; + ielength++; } out_ie[initial_out_len +1 ] =0x07 ; out_ie[initial_out_len +6 ] =0x00 ;
@@ -2064,15 +2064,13 @@ static int rtw_append_pmkid(struct adapter *Adapter, int iEntry, u8 *ie, uint ieif (ie[13 ] <=20 ) {/* The RSN IE didn't include the PMK ID, append the PMK information */ - ie[ie_len] =1 ; - ie_len++; - ie[ie_len] =0 ;/* PMKID count = 0x0100 */ - ie_len++; -memcpy (&ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID,16 ); - - ie_len +=16 ; - ie[13 ] +=18 ;/* PMKID length = 2+16 */ - + ie[ie_len] =1 ; + ie_len++; + ie[ie_len] =0 ;/* PMKID count = 0x0100 */ + ie_len++; +memcpy (&ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID,16 ); + ie_len +=16 ; + ie[13 ] +=18 ;/* PMKID length = 2+16 */ }return ie_len; }
@@ -2091,9 +2089,9 @@ signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, umemcpy (out_ie, in_ie,12 ); ielength =12 ;if ((ndisauthmode == Ndis802_11AuthModeWPA) || (ndisauthmode == Ndis802_11AuthModeWPAPSK)) - authmode =WLAN_EID_VENDOR_SPECIFIC ; + authmode =WLAN_EID_VENDOR_SPECIFIC ;if ((ndisauthmode == Ndis802_11AuthModeWPA2) || (ndisauthmode == Ndis802_11AuthModeWPA2PSK)) - authmode =WLAN_EID_RSN ; + authmode =WLAN_EID_RSN ;if (check_fwstate (pmlmepriv,WIFI_UNDER_WPS )) {memcpy (out_ie+ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len);
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +1 -1
@@ -5447,7 +5447,7 @@ u8 disconnect_hdl(struct adapter *padapter, unsigned char *pbuf)u8 val8;if (is_client_associated_to_ap (padapter)) -issue_deauth_ex (padapter, pnetwork->mac_address,WLAN_REASON_DEAUTH_LEAVING , param->deauth_timeout_ms/100 ,100 ); +issue_deauth_ex (padapter, pnetwork->mac_address,WLAN_REASON_DEAUTH_LEAVING , param->deauth_timeout_ms/100 ,100 );if (((pmlmeinfo->state&0x03 ) ==WIFI_FW_ADHOC_STATE ) || ((pmlmeinfo->state&0x03 ) ==WIFI_FW_AP_STATE )) {/* Stop BCN */
drivers/staging/rtl8723bs/core/rtw_recv.c +3 -3
@@ -161,7 +161,7 @@ int rtw_free_recvframe(union recv_frame *precvframe, struct __queue *pfree_recv_if (padapter) {if (pfree_recv_queue == &precvpriv->free_recv_queue) - precvpriv->free_recvframe_cnt++; + precvpriv->free_recvframe_cnt++; }spin_unlock_bh (&pfree_recv_queue->lock);return _SUCCESS;
@@ -691,8 +691,8 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame *if (bmcast) {/* For AP mode, if DA == MCAST, then BSSID should be also MCAST */ if (!IS_MCAST (pattrib->bssid)) { - ret = _FAIL; - goto exit; + ret = _FAIL; + goto exit; } }else {/* not mc-frame */ /* For AP mode, if DA is non-MCAST, then it must be BSSID, and bssid == BSSID */
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +1 -1
@@ -551,7 +551,7 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)else if (pacl_list->mode ==2 )/* deny unless in accept list */ res = match;else - res = true; + res = true;return res; }
Signature · 1 line
2.34.1
Quoted 2 lines · Emily Peri
Remove/add tabs in block statements in rtl8723bs/core to fix checkpatch warnings for suspect code indent for conditionals.
It's a bit picky, but one case is a loop.
julia
Quoted 141 lines
Signed-off-by Emily Peri <[email protected]>--- drivers/staging/rtl8723bs/core/rtw_mlme.c | 30 +++++++++---------- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 +- drivers/staging/rtl8723bs/core/rtw_recv.c | 6 ++-- drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 2 +- 4 files changed, 19 insertions(+), 21 deletions(-)drivers/staging/rtl8723bs/core/rtw_mlme.c +14
-16@@ -389,7 +389,7 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 fea__le16 tmps, tmpd;if (rtw_bug_check (dst, src, &s_cap, &d_cap) == false) -return false; +return false;memcpy ((u8 *)&tmps,rtw_get_capability_from_ie (src->ies),2 );memcpy ((u8 *)&tmpd,rtw_get_capability_from_ie (dst->ies),2 );@@ -669,7 +669,7 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetworuint ie_len =0 ;if ((desired_encmode == Ndis802_11EncryptionDisabled) && (privacy !=0 )) - bselected = false; + bselected = false;if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) { p =rtw_get_ie (pnetwork->network.ies + _BEACON_IE_OFFSET_,WLAN_EID_RSN , &ie_len, (pnetwork->network.ie_length - _BEACON_IE_OFFSET_));@@ -795,7 +795,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) pmlmepriv->to_join = false; s_ret =rtw_select_and_join_from_scanned_queue (pmlmepriv);if (s_ret == _SUCCESS) { -_set_timer (&pmlmepriv->assoc_timer,MAX_JOIN_TIMEOUT ); +_set_timer (&pmlmepriv->assoc_timer,MAX_JOIN_TIMEOUT ); }else if (s_ret ==2 ) {/* there is no need to wait for join */ _clr_fwstate_ (pmlmepriv, _FW_UNDER_LINKING);rtw_indicate_connect (adapter);@@ -2010,8 +2010,8 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_if (in_ie[i] ==0xDD && in_ie[i+2 ] ==0x00 && in_ie[i+3 ] ==0x50 && in_ie[i+4 ] ==0xF2 && in_ie[i+5 ] ==0x02 && i+5 < in_len) {/* WMM element ID and OUI */ for (j = i; j < i +9 ; j++) { - out_ie[ielength] = in_ie[j]; - ielength++; + out_ie[ielength] = in_ie[j]; + ielength++; } out_ie[initial_out_len +1 ] =0x07 ; out_ie[initial_out_len +6 ] =0x00 ;@@ -2064,15 +2064,13 @@ static int rtw_append_pmkid(struct adapter *Adapter, int iEntry, u8 *ie, uint ieif (ie[13 ] <=20 ) {/* The RSN IE didn't include the PMK ID, append the PMK information */ - ie[ie_len] =1 ; - ie_len++; - ie[ie_len] =0 ;/* PMKID count = 0x0100 */ - ie_len++; -memcpy (&ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID,16 ); - - ie_len +=16 ; - ie[13 ] +=18 ;/* PMKID length = 2+16 */ - + ie[ie_len] =1 ; + ie_len++; + ie[ie_len] =0 ;/* PMKID count = 0x0100 */ + ie_len++; +memcpy (&ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID,16 ); + ie_len +=16 ; + ie[13 ] +=18 ;/* PMKID length = 2+16 */ }return ie_len; }@@ -2091,9 +2089,9 @@ signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, umemcpy (out_ie, in_ie,12 ); ielength =12 ;if ((ndisauthmode == Ndis802_11AuthModeWPA) || (ndisauthmode == Ndis802_11AuthModeWPAPSK)) - authmode =WLAN_EID_VENDOR_SPECIFIC ; + authmode =WLAN_EID_VENDOR_SPECIFIC ;if ((ndisauthmode == Ndis802_11AuthModeWPA2) || (ndisauthmode == Ndis802_11AuthModeWPA2PSK)) - authmode =WLAN_EID_RSN ; + authmode =WLAN_EID_RSN ;if (check_fwstate (pmlmepriv,WIFI_UNDER_WPS )) {memcpy (out_ie+ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len);drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +1
-1@@ -5447,7 +5447,7 @@ u8 disconnect_hdl(struct adapter *padapter, unsigned char *pbuf)u8 val8;if (is_client_associated_to_ap (padapter)) -issue_deauth_ex (padapter, pnetwork->mac_address,WLAN_REASON_DEAUTH_LEAVING , param->deauth_timeout_ms/100 ,100 ); +issue_deauth_ex (padapter, pnetwork->mac_address,WLAN_REASON_DEAUTH_LEAVING , param->deauth_timeout_ms/100 ,100 );if (((pmlmeinfo->state&0x03 ) ==WIFI_FW_ADHOC_STATE ) || ((pmlmeinfo->state&0x03 ) ==WIFI_FW_AP_STATE )) {/* Stop BCN */ drivers/staging/rtl8723bs/core/rtw_recv.c +3
-3@@ -161,7 +161,7 @@ int rtw_free_recvframe(union recv_frame *precvframe, struct __queue *pfree_recv_if (padapter) {if (pfree_recv_queue == &precvpriv->free_recv_queue) - precvpriv->free_recvframe_cnt++; + precvpriv->free_recvframe_cnt++; }spin_unlock_bh (&pfree_recv_queue->lock);return _SUCCESS;@@ -691,8 +691,8 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame *if (bmcast) {/* For AP mode, if DA == MCAST, then BSSID should be also MCAST */ if (!IS_MCAST (pattrib->bssid)) { - ret = _FAIL; - goto exit; + ret = _FAIL; + goto exit; } }else {/* not mc-frame */ /* For AP mode, if DA is non-MCAST, then it must be BSSID, and bssid == BSSID */ drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +1
-2@@ -551,7 +551,7 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)else if (pacl_list->mode ==2 )/* deny unless in accept list */ res = match;else - res = true; + res = true;return res; } --2.34.1
Quoted 10 lines · Julia Lawall
Quoted 2 lines · Emily Peri
Remove/add tabs in block statements in rtl8723bs/core to fix checkpatch warnings for suspect code indent for conditionals.
It's a bit picky, but one case is a loop.
julia
Thanks Julia, I did notice that too. I hoped by writing 'block statements' in the description I could cover that case. Checkpatch actually gave the same "WARNING: suspect code indent for conditional statements" for both the loop and the conditionals, so that was what I was referring to in the descripton. I agree I could have made that more clear!
Quoted 140 lines
Quoted 140 lines
Signed-off-by Emily Peri <[email protected]>--- drivers/staging/rtl8723bs/core/rtw_mlme.c | 30 +++++++++---------- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 +- drivers/staging/rtl8723bs/core/rtw_recv.c | 6 ++-- drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 2 +- 4 files changed, 19 insertions(+), 21 deletions(-)drivers/staging/rtl8723bs/core/rtw_mlme.c +14
-16@@ -389,7 +389,7 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 fea__le16 tmps, tmpd;if (rtw_bug_check (dst, src, &s_cap, &d_cap) == false) -return false; +return false;memcpy ((u8 *)&tmps,rtw_get_capability_from_ie (src->ies),2 );memcpy ((u8 *)&tmpd,rtw_get_capability_from_ie (dst->ies),2 );@@ -669,7 +669,7 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetworuint ie_len =0 ;if ((desired_encmode == Ndis802_11EncryptionDisabled) && (privacy !=0 )) - bselected = false; + bselected = false;if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) { p =rtw_get_ie (pnetwork->network.ies + _BEACON_IE_OFFSET_,WLAN_EID_RSN , &ie_len, (pnetwork->network.ie_length - _BEACON_IE_OFFSET_));@@ -795,7 +795,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) pmlmepriv->to_join = false; s_ret =rtw_select_and_join_from_scanned_queue (pmlmepriv);if (s_ret == _SUCCESS) { -_set_timer (&pmlmepriv->assoc_timer,MAX_JOIN_TIMEOUT ); +_set_timer (&pmlmepriv->assoc_timer,MAX_JOIN_TIMEOUT ); }else if (s_ret ==2 ) {/* there is no need to wait for join */ _clr_fwstate_ (pmlmepriv, _FW_UNDER_LINKING);rtw_indicate_connect (adapter);@@ -2010,8 +2010,8 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_if (in_ie[i] ==0xDD && in_ie[i+2 ] ==0x00 && in_ie[i+3 ] ==0x50 && in_ie[i+4 ] ==0xF2 && in_ie[i+5 ] ==0x02 && i+5 < in_len) {/* WMM element ID and OUI */ for (j = i; j < i +9 ; j++) { - out_ie[ielength] = in_ie[j]; - ielength++; + out_ie[ielength] = in_ie[j]; + ielength++; } out_ie[initial_out_len +1 ] =0x07 ; out_ie[initial_out_len +6 ] =0x00 ;@@ -2064,15 +2064,13 @@ static int rtw_append_pmkid(struct adapter *Adapter, int iEntry, u8 *ie, uint ieif (ie[13 ] <=20 ) {/* The RSN IE didn't include the PMK ID, append the PMK information */ - ie[ie_len] =1 ; - ie_len++; - ie[ie_len] =0 ;/* PMKID count = 0x0100 */ - ie_len++; -memcpy (&ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID,16 ); - - ie_len +=16 ; - ie[13 ] +=18 ;/* PMKID length = 2+16 */ - + ie[ie_len] =1 ; + ie_len++; + ie[ie_len] =0 ;/* PMKID count = 0x0100 */ + ie_len++; +memcpy (&ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID,16 ); + ie_len +=16 ; + ie[13 ] +=18 ;/* PMKID length = 2+16 */ }return ie_len; }@@ -2091,9 +2089,9 @@ signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, umemcpy (out_ie, in_ie,12 ); ielength =12 ;if ((ndisauthmode == Ndis802_11AuthModeWPA) || (ndisauthmode == Ndis802_11AuthModeWPAPSK)) - authmode =WLAN_EID_VENDOR_SPECIFIC ; + authmode =WLAN_EID_VENDOR_SPECIFIC ;if ((ndisauthmode == Ndis802_11AuthModeWPA2) || (ndisauthmode == Ndis802_11AuthModeWPA2PSK)) - authmode =WLAN_EID_RSN ; + authmode =WLAN_EID_RSN ;if (check_fwstate (pmlmepriv,WIFI_UNDER_WPS )) {memcpy (out_ie+ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len);drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +1
-1@@ -5447,7 +5447,7 @@ u8 disconnect_hdl(struct adapter *padapter, unsigned char *pbuf)u8 val8;if (is_client_associated_to_ap (padapter)) -issue_deauth_ex (padapter, pnetwork->mac_address,WLAN_REASON_DEAUTH_LEAVING , param->deauth_timeout_ms/100 ,100 ); +issue_deauth_ex (padapter, pnetwork->mac_address,WLAN_REASON_DEAUTH_LEAVING , param->deauth_timeout_ms/100 ,100 );if (((pmlmeinfo->state&0x03 ) ==WIFI_FW_ADHOC_STATE ) || ((pmlmeinfo->state&0x03 ) ==WIFI_FW_AP_STATE )) {/* Stop BCN */ drivers/staging/rtl8723bs/core/rtw_recv.c +3
-3@@ -161,7 +161,7 @@ int rtw_free_recvframe(union recv_frame *precvframe, struct __queue *pfree_recv_if (padapter) {if (pfree_recv_queue == &precvpriv->free_recv_queue) - precvpriv->free_recvframe_cnt++; + precvpriv->free_recvframe_cnt++; }spin_unlock_bh (&pfree_recv_queue->lock);return _SUCCESS;@@ -691,8 +691,8 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame *if (bmcast) {/* For AP mode, if DA == MCAST, then BSSID should be also MCAST */ if (!IS_MCAST (pattrib->bssid)) { - ret = _FAIL; - goto exit; + ret = _FAIL; + goto exit; } }else {/* not mc-frame */ /* For AP mode, if DA is non-MCAST, then it must be BSSID, and bssid == BSSID */ drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +1
-2@@ -551,7 +551,7 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)else if (pacl_list->mode ==2 )/* deny unless in accept list */ res = match;else - res = true; + res = true;return res; } --2.34.1