lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <11086518.O9o76ZdvQC@joonhwan-virtualbox>
Date:   Sat, 16 Jun 2018 14:45:17 +0900
From:   "JoonHwan.Kim" <spilit464@...il.com>
To:     gregkh@...uxfoundation.org
Cc:     Larry.Finger@...inger.net, florian.c.schilhabel@...glemail.com,
        stefano.manni@...il.com, liamryandev@...il.com,
        martin@...tinhomuth.de, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] staging: rtl8712: Adjust if statements to reduce indentation level

Merge two condition of if statements in
r8712_surveydone_event_callback()

Signed-off-by: Joonhwan Kim <spilit464@...il.com>
---
 drivers/staging/rtl8712/rtl871x_mlme.c | 51 +++++++++++++-------------
 1 file changed, 25 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c
index ac547ddd72d1..b8618b0565d5 100644
--- a/drivers/staging/rtl8712/rtl871x_mlme.c
+++ b/drivers/staging/rtl8712/rtl871x_mlme.c
@@ -566,32 +566,31 @@ void r8712_surveydone_event_callback(struct _adapter *adapter, u8 *pbuf)
 	}
 
 	if (pmlmepriv->to_join) {
-		if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
-			if (!check_fwstate(pmlmepriv, _FW_LINKED)) {
-				set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
-
-				if (r8712_select_and_join_from_scan(pmlmepriv)
-				    == _SUCCESS) {
-					mod_timer(&pmlmepriv->assoc_timer, jiffies +
-						  msecs_to_jiffies(MAX_JOIN_TIMEOUT));
-				} else {
-					struct wlan_bssid_ex *pdev_network =
-					  &(adapter->registrypriv.dev_network);
-					u8 *pibss =
-						 adapter->registrypriv.
-							dev_network.MacAddress;
-					pmlmepriv->fw_state ^= _FW_UNDER_SURVEY;
-					memcpy(&pdev_network->Ssid,
-						&pmlmepriv->assoc_ssid,
-						sizeof(struct
-							 ndis_802_11_ssid));
-					r8712_update_registrypriv_dev_network
-						(adapter);
-					r8712_generate_random_ibss(pibss);
-					pmlmepriv->fw_state =
-						 WIFI_ADHOC_MASTER_STATE;
-					pmlmepriv->to_join = false;
-				}
+		if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) &&
+		    !check_fwstate(pmlmepriv, _FW_LINKED)) {
+			set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
+
+			if (r8712_select_and_join_from_scan(pmlmepriv)
+			    == _SUCCESS) {
+				mod_timer(&pmlmepriv->assoc_timer, jiffies +
+					  msecs_to_jiffies(MAX_JOIN_TIMEOUT));
+			} else {
+				struct wlan_bssid_ex *pdev_network =
+				  &(adapter->registrypriv.dev_network);
+				u8 *pibss =
+					 adapter->registrypriv.
+						dev_network.MacAddress;
+				pmlmepriv->fw_state ^= _FW_UNDER_SURVEY;
+				memcpy(&pdev_network->Ssid,
+					&pmlmepriv->assoc_ssid,
+					sizeof(struct
+						 ndis_802_11_ssid));
+				r8712_update_registrypriv_dev_network
+					(adapter);
+				r8712_generate_random_ibss(pibss);
+				pmlmepriv->fw_state =
+					 WIFI_ADHOC_MASTER_STATE;
+				pmlmepriv->to_join = false;
 			}
 		} else {
 			pmlmepriv->to_join = false;
-- 
2.17.1




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ