[PATCH] staging: rtl8712: avoid multiple line dereference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



fix post-commit hook checkpatch issues:

WARNING: Avoid multiple line dereference - prefer 'adapter->mlmepriv.cur_network.network.InfrastructureMode'
+			adapter->mlmepriv.cur_network.network.
+			InfrastructureMode)

WARNING: Avoid multiple line dereference - prefer 'adapter->registrypriv.dev_network.MacAddress'
+						 adapter->registrypriv.
+							dev_network.MacAddress;

WARNING: Avoid multiple line dereference - prefer 'pnetwork->network.Configuration.FHConfig.DwellTime'
+		 le32_to_cpu(pnetwork->network.Configuration.FHConfig.
+			     DwellTime);

WARNING: Avoid multiple line dereference - prefer 'pnetwork->network.Configuration.FHConfig.HopPattern'
+		 le32_to_cpu(pnetwork->network.Configuration.
+			     FHConfig.HopPattern);

WARNING: Avoid multiple line dereference - prefer 'pmlmepriv->scanned_queue'
+					    r8712_find_network(&pmlmepriv->
+					    scanned_queue,

WARNING: Avoid multiple line dereference - prefer 'pmlmepriv->scanned_queue'
+					     r8712_find_network(&pmlmepriv->
+					     scanned_queue,

WARNING: Avoid multiple line dereference - prefer 'pstapriv->sta_hash_lock'
+					spin_lock_irqsave(&pstapriv->
+						sta_hash_lock, irqL2);

WARNING: Avoid multiple line dereference - prefer 'pstapriv->sta_hash_lock'
+					spin_unlock_irqrestore(&(pstapriv->
+						sta_hash_lock), irqL2);

WARNING: Avoid multiple line dereference - prefer 'pmlmepriv->scanned_queue'
+						 r8712_find_network(&pmlmepriv->
+						 scanned_queue,

WARNING: Avoid multiple line dereference - prefer 'pnetwork->network.MacAddress'
+						 pnetwork->network.
+						 MacAddress);

WARNING: Avoid multiple line dereference - prefer 'pmlmepriv->scanned_queue'
+				ptarget_wlan = r8712_find_network(&pmlmepriv->
+						scanned_queue,

WARNING: Avoid multiple line dereference - prefer 'adapter->securitypriv.AuthAlgrthm'
+					if (adapter->securitypriv.
+					    AuthAlgrthm == 2) {

WARNING: Avoid multiple line dereference - prefer 'adapter->securitypriv.binstallGrpkey'
+						adapter->securitypriv.
+							binstallGrpkey =

WARNING: Avoid multiple line dereference - prefer 'adapter->securitypriv.busetkipkey'
+						adapter->securitypriv.
+							busetkipkey =

WARNING: Avoid multiple line dereference - prefer 'adapter->securitypriv.bgrpkey_handshake'
+						adapter->securitypriv.
+							bgrpkey_handshake =

WARNING: Avoid multiple line dereference - prefer 'adapter->securitypriv.PrivacyAlgrthm'
+							 adapter->securitypriv.
+							 PrivacyAlgrthm;

WARNING: Avoid multiple line dereference - prefer 'ptarget_sta->x_UncstKey'
+						memset((u8 *)&ptarget_sta->
+							 x_UncstKey,

WARNING: Avoid multiple line dereference - prefer 'ptarget_sta->tkiprxmickey'
+						memset((u8 *)&ptarget_sta->
+							 tkiprxmickey,

WARNING: Avoid multiple line dereference - prefer 'ptarget_sta->tkiptxmickey'
+						memset((u8 *)&ptarget_sta->
+							 tkiptxmickey,

WARNING: Avoid multiple line dereference - prefer 'ptarget_sta->txpn'
+						memset((u8 *)&ptarget_sta->
+							 txpn, 0,

WARNING: Avoid multiple line dereference - prefer 'ptarget_sta->rxpn'
+						memset((u8 *)&ptarget_sta->
+							 rxpn, 0,

WARNING: Avoid multiple line dereference - prefer 'tgt_network->network'
+				r8712_get_wlan_bssid_ex_sz(&tgt_network->
+							network));

WARNING: Avoid multiple line dereference - prefer 'pmlmepriv->cur_network.network'
+					if (is_same_network(&pmlmepriv->
+					    cur_network.network,

Signed-off-by: Sergei Krainov <sergei.krainov.lkd@xxxxxxxxx>
---
 drivers/staging/rtl8712/rtl871x_mlme.c | 73 +++++++++-----------------
 1 file changed, 25 insertions(+), 48 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c
index 8a97307fbbd6..26acb4069d3d 100644
--- a/drivers/staging/rtl8712/rtl871x_mlme.c
+++ b/drivers/staging/rtl8712/rtl871x_mlme.c
@@ -431,8 +431,7 @@ static int is_desired_network(struct _adapter *adapter,
 		bselected = false;
 	if (check_fwstate(&adapter->mlmepriv, WIFI_ADHOC_STATE)) {
 		if (pnetwork->network.InfrastructureMode !=
-			adapter->mlmepriv.cur_network.network.
-			InfrastructureMode)
+			adapter->mlmepriv.cur_network.network.InfrastructureMode)
 			bselected = false;
 	}
 	return bselected;
@@ -539,8 +538,7 @@ void r8712_surveydone_event_callback(struct _adapter *adapter, u8 *pbuf)
 					struct wlan_bssid_ex *pdev_network =
 					  &(adapter->registrypriv.dev_network);
 					u8 *pibss =
-						 adapter->registrypriv.
-							dev_network.MacAddress;
+						 adapter->registrypriv.dev_network.MacAddress;
 					pmlmepriv->fw_state ^= _FW_UNDER_SURVEY;
 					memcpy(&pdev_network->Ssid,
 						&pmlmepriv->assoc_ssid,
@@ -688,11 +686,9 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf)
 	pnetwork->network.Configuration.DSConfig =
 		 le32_to_cpu(pnetwork->network.Configuration.DSConfig);
 	pnetwork->network.Configuration.FHConfig.DwellTime =
-		 le32_to_cpu(pnetwork->network.Configuration.FHConfig.
-			     DwellTime);
+		 le32_to_cpu(pnetwork->network.Configuration.FHConfig.DwellTime);
 	pnetwork->network.Configuration.FHConfig.HopPattern =
-		 le32_to_cpu(pnetwork->network.Configuration.
-			     FHConfig.HopPattern);
+		 le32_to_cpu(pnetwork->network.Configuration.FHConfig.HopPattern);
 	pnetwork->network.Configuration.FHConfig.HopSet =
 		 le32_to_cpu(pnetwork->network.Configuration.FHConfig.HopSet);
 	pnetwork->network.Configuration.FHConfig.Length =
@@ -717,36 +713,29 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf)
 			if (check_fwstate(pmlmepriv, _FW_LINKED)) {
 				if (the_same_macaddr) {
 					ptarget_wlan =
-					    r8712_find_network(&pmlmepriv->
-					    scanned_queue,
+					    r8712_find_network(&pmlmepriv->scanned_queue,
 					    cur_network->network.MacAddress);
 				} else {
 					pcur_wlan =
-					     r8712_find_network(&pmlmepriv->
-					     scanned_queue,
+					     r8712_find_network(&pmlmepriv->scanned_queue,
 					     cur_network->network.MacAddress);
 					if (pcur_wlan)
 						pcur_wlan->fixed = false;
 
 					pcur_sta = r8712_get_stainfo(pstapriv,
 					     cur_network->network.MacAddress);
-					spin_lock_irqsave(&pstapriv->
-						sta_hash_lock, irqL2);
+					spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL2);
 					r8712_free_stainfo(adapter, pcur_sta);
-					spin_unlock_irqrestore(&(pstapriv->
-						sta_hash_lock), irqL2);
+					spin_unlock_irqrestore(&(pstapriv->sta_hash_lock), irqL2);
 
 					ptarget_wlan =
-						 r8712_find_network(&pmlmepriv->
-						 scanned_queue,
-						 pnetwork->network.
-						 MacAddress);
+						 r8712_find_network(&pmlmepriv->scanned_queue,
+						 pnetwork->network.MacAddress);
 					if (ptarget_wlan)
 						ptarget_wlan->fixed = true;
 				}
 			} else {
-				ptarget_wlan = r8712_find_network(&pmlmepriv->
-						scanned_queue,
+				ptarget_wlan = r8712_find_network(&pmlmepriv->scanned_queue,
 						pnetwork->network.MacAddress);
 				if (ptarget_wlan)
 					ptarget_wlan->fixed = true;
@@ -779,39 +768,29 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf)
 					ptarget_sta->aid = pnetwork->join_res;
 					ptarget_sta->qos_option = 1;
 					ptarget_sta->mac_id = 5;
-					if (adapter->securitypriv.
-					    AuthAlgrthm == 2) {
-						adapter->securitypriv.
-							binstallGrpkey =
+					if (adapter->securitypriv.AuthAlgrthm == 2) {
+						adapter->securitypriv.binstallGrpkey =
 							 false;
-						adapter->securitypriv.
-							busetkipkey =
+						adapter->securitypriv.busetkipkey =
 							 false;
-						adapter->securitypriv.
-							bgrpkey_handshake =
+						adapter->securitypriv.bgrpkey_handshake =
 							 false;
-						ptarget_sta->ieee8021x_blocked
-							 = true;
+						ptarget_sta->ieee8021x_blocked =
+							 true;
 						ptarget_sta->XPrivacy =
-							 adapter->securitypriv.
-							 PrivacyAlgrthm;
-						memset((u8 *)&ptarget_sta->
-							 x_UncstKey,
+							 adapter->securitypriv.PrivacyAlgrthm;
+						memset((u8 *)&ptarget_sta->x_UncstKey,
 							 0,
 							 sizeof(union Keytype));
-						memset((u8 *)&ptarget_sta->
-							 tkiprxmickey,
+						memset((u8 *)&ptarget_sta->tkiprxmickey,
 							 0,
 							 sizeof(union Keytype));
-						memset((u8 *)&ptarget_sta->
-							 tkiptxmickey,
+						memset((u8 *)&ptarget_sta->tkiptxmickey,
 							 0,
 							 sizeof(union Keytype));
-						memset((u8 *)&ptarget_sta->
-							 txpn, 0,
+						memset((u8 *)&ptarget_sta->txpn, 0,
 							 sizeof(union pn48));
-						memset((u8 *)&ptarget_sta->
-							 rxpn, 0,
+						memset((u8 *)&ptarget_sta->rxpn, 0,
 							 sizeof(union pn48));
 					}
 				} else {
@@ -942,8 +921,7 @@ void r8712_stadel_event_callback(struct _adapter *adapter, u8 *pbuf)
 			pdev_network = &(adapter->registrypriv.dev_network);
 			pibss = adapter->registrypriv.dev_network.MacAddress;
 			memcpy(pdev_network, &tgt_network->network,
-				r8712_get_wlan_bssid_ex_sz(&tgt_network->
-							network));
+				r8712_get_wlan_bssid_ex_sz(&tgt_network->network));
 			memcpy(&pdev_network->Ssid,
 				&pmlmepriv->assoc_ssid,
 				sizeof(struct ndis_802_11_ssid));
@@ -1092,8 +1070,7 @@ int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv)
 			src_ssid = pmlmepriv->assoc_bssid;
 			if (!memcmp(dst_ssid, src_ssid, ETH_ALEN)) {
 				if (check_fwstate(pmlmepriv, _FW_LINKED)) {
-					if (is_same_network(&pmlmepriv->
-					    cur_network.network,
+					if (is_same_network(&pmlmepriv->cur_network.network,
 					    &pnetwork->network)) {
 						_clr_fwstate_(pmlmepriv,
 							_FW_UNDER_LINKING);
-- 
2.25.1




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux