staging: rtl8723bs: cleanups for checkpatch fixes
cover staging: rtl8723bs: cleanups for checkpatch fixes
This patch series removes errors and warnings generated by checkpatch
Kang Minchul (4):
staging: rtl8723bs: replace code indent as tabs
staging: rtl8723bs: Relocate constant on the right side of test
staging: rtl8723bs: Make switch and case at the same indent
staging: rtl8723bs: Add a blank line after declarations
.../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 106 +++++++++--------- 1 file changed, 54 insertions(+), 52 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/4 staging: rtl8723bs: replace code indent as tabs
This patch removes error below generated by checkpatch
ERROR: code indent should use tabs where possible
--- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +6 -6
@@ -198,7 +198,7 @@ static int rtw_ieee80211_channel_to_frequency(int chan, int band)if (band ==NL80211_BAND_2GHZ ) {if (chan ==14 )return 2484 ; -else if (chan <14 ) +else if (chan <14 )return 2407 + chan *5 ; }
@@ -810,7 +810,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_parammemcpy (padapter->securitypriv.dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len >16 ?16 : param->u.crypt.key_len));memcpy (padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[16 ]),8 );memcpy (padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24 ]),8 ); - padapter->securitypriv.binstallGrpkey = true; + padapter->securitypriv.binstallGrpkey = true; padapter->securitypriv.dot118021XGrpKeyid = param->u.crypt.idx;rtw_set_key (padapter, &padapter->securitypriv, param->u.crypt.idx,1 , true);
@@ -920,9 +920,9 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, ret =rtw_cfg80211_ap_set_encryption (ndev, param, param_len); }else if (check_fwstate (pmlmepriv,WIFI_ADHOC_STATE ) == true - ||check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE ) == true) { - ret =rtw_cfg80211_set_encryption (ndev, param, param_len); - } + ||check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE ) == true) { + ret =rtw_cfg80211_set_encryption (ndev, param, param_len); + } addkey_end:kfree (param);
@@ -2349,7 +2349,7 @@ static int cfg80211_rtw_start_ap(struct wiphy *wiphy, struct net_device *ndev, }static int cfg80211_rtw_change_beacon (struct wiphy *wiphy,struct net_device *ndev, -struct cfg80211_beacon_data *info) +struct cfg80211_beacon_data *info) {struct adapter *adapter =rtw_netdev_priv (ndev);
Signature · 1 line
2.34.1
PATCH 2/4 staging: rtl8723bs: Relocate constant on the right side of test
In reply to Kang MinchulThis patch fixes following warning generated by checkpatch:
WARNING: Comparisons should place the constant on the right side of the test
--- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +6 -6
@@ -1066,7 +1066,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy, } } -if (_FAIL ==rtw_pwr_wakeup (padapter)) { +if (rtw_pwr_wakeup (padapter) == _FAIL) { ret = -EPERM ; goto exit; }
@@ -1240,7 +1240,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy }rtw_ps_deny (padapter,PS_DENY_SCAN ); -if (_FAIL ==rtw_pwr_wakeup (padapter)) { +if (rtw_pwr_wakeup (padapter) == _FAIL) { need_indicate_scan_done = true; goto check_need_indicate_scan_done; }
@@ -1583,7 +1583,7 @@ static int cfg80211_rtw_join_ibss(struct wiphy *wiphy, struct net_device *ndev,struct mlme_priv *pmlmepriv = &padapter->mlmepriv;int ret =0 ; -if (_FAIL ==rtw_pwr_wakeup (padapter)) { +if (rtw_pwr_wakeup (padapter) == _FAIL) { ret = -EPERM ; goto exit; }
@@ -1674,7 +1674,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, }rtw_ps_deny (padapter,PS_DENY_JOIN ); -if (_FAIL ==rtw_pwr_wakeup (padapter)) { +if (rtw_pwr_wakeup (padapter) == _FAIL) { ret = -EPERM ; goto exit; }
@@ -2468,7 +2468,7 @@ static int cfg80211_rtw_dump_station(struct wiphy *wiphy, struct net_device *ndespin_lock_bh (&pstapriv->asoc_list_lock); psta =rtw_sta_info_get_by_idx (idx, pstapriv);spin_unlock_bh (&pstapriv->asoc_list_lock); -if (NULL == psta) { +if (psta ==NULL ) { ret = -ENOENT ; goto exit; }
@@ -2603,7 +2603,7 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, goto exit;rtw_ps_deny (padapter,PS_DENY_MGNT_TX ); -if (_FAIL ==rtw_pwr_wakeup (padapter)) { +if (rtw_pwr_wakeup (padapter) == _FAIL) { ret = -EFAULT ; goto cancel_ps_deny; }
Signature · 1 line
2.34.1
PATCH 3/4 staging: rtl8723bs: Make switch and case at the same indent
In reply to Kang MinchulThis patch fixes switch and case as linux kernel coding style and amend this error generated by checkpatch:
ERROR: switch and case should be at the same indent
--- .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-)
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +40 -40
@@ -1500,49 +1500,49 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel pairwise_cipher =WPA_CIPHER_NONE ;switch (group_cipher) { -case WPA_CIPHER_NONE : - padapter->securitypriv.dot118021XGrpPrivacy = _NO_PRIVACY_; - padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled; -break ; -case WPA_CIPHER_WEP40 : - padapter->securitypriv.dot118021XGrpPrivacy = _WEP40_; - padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; -break ; -case WPA_CIPHER_TKIP : - padapter->securitypriv.dot118021XGrpPrivacy = _TKIP_; - padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption2Enabled; -break ; -case WPA_CIPHER_CCMP : - padapter->securitypriv.dot118021XGrpPrivacy = _AES_; - padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption3Enabled; -break ; -case WPA_CIPHER_WEP104 : - padapter->securitypriv.dot118021XGrpPrivacy = _WEP104_; - padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; -break ; +case WPA_CIPHER_NONE : + padapter->securitypriv.dot118021XGrpPrivacy = _NO_PRIVACY_; + padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled; +break ; +case WPA_CIPHER_WEP40 : + padapter->securitypriv.dot118021XGrpPrivacy = _WEP40_; + padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; +break ; +case WPA_CIPHER_TKIP : + padapter->securitypriv.dot118021XGrpPrivacy = _TKIP_; + padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption2Enabled; +break ; +case WPA_CIPHER_CCMP : + padapter->securitypriv.dot118021XGrpPrivacy = _AES_; + padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption3Enabled; +break ; +case WPA_CIPHER_WEP104 : + padapter->securitypriv.dot118021XGrpPrivacy = _WEP104_; + padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; +break ; }switch (pairwise_cipher) { -case WPA_CIPHER_NONE : - padapter->securitypriv.dot11PrivacyAlgrthm = _NO_PRIVACY_; - padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled; -break ; -case WPA_CIPHER_WEP40 : - padapter->securitypriv.dot11PrivacyAlgrthm = _WEP40_; - padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; -break ; -case WPA_CIPHER_TKIP : - padapter->securitypriv.dot11PrivacyAlgrthm = _TKIP_; - padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption2Enabled; -break ; -case WPA_CIPHER_CCMP : - padapter->securitypriv.dot11PrivacyAlgrthm = _AES_; - padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption3Enabled; -break ; -case WPA_CIPHER_WEP104 : - padapter->securitypriv.dot11PrivacyAlgrthm = _WEP104_; - padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; -break ; +case WPA_CIPHER_NONE : + padapter->securitypriv.dot11PrivacyAlgrthm = _NO_PRIVACY_; + padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled; +break ; +case WPA_CIPHER_WEP40 : + padapter->securitypriv.dot11PrivacyAlgrthm = _WEP40_; + padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; +break ; +case WPA_CIPHER_TKIP : + padapter->securitypriv.dot11PrivacyAlgrthm = _TKIP_; + padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption2Enabled; +break ; +case WPA_CIPHER_CCMP : + padapter->securitypriv.dot11PrivacyAlgrthm = _AES_; + padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption3Enabled; +break ; +case WPA_CIPHER_WEP104 : + padapter->securitypriv.dot11PrivacyAlgrthm = _WEP104_; + padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; +break ; } {/* handle wps_ie */
Signature · 1 line
2.34.1
PATCH 4/4 staging: rtl8723bs: Add a blank line after declarations
In reply to Kang MinchulThis patch adds a blank line in order to fix checkpatch warning
--- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +2 -0
@@ -1849,6 +1849,7 @@ static int cfg80211_rtw_get_txpower(struct wiphy *wiphy,inline bool rtw_cfg80211_pwr_mgmt (struct adapter *adapter) {struct rtw_wdev_priv *rtw_wdev_priv =adapter_wdev_data (adapter); +return rtw_wdev_priv->power_mgmt; }
@@ -1954,6 +1955,7 @@ void rtw_cfg80211_indicate_sta_assoc(struct adapter *padapter, u8 *pmgmt_frame, {struct station_info sinfo = {};u8 ie_offset; +if (GetFrameSubType (pmgmt_frame) ==WIFI_ASSOCREQ ) ie_offset = _ASOCREQ_IE_OFFSET_;else /* WIFI_REASSOCREQ */
Signature · 1 line
2.34.1