wlan: Remove redundant code in __wlan_hdd_cfg80211_connect()
qcacld-2.0 to prima propagation
Make changes to invoke wlan_hdd_cfg80211_connect_start() one time instead
of two instances of invoking the same function using local variables.
Change-Id: I2aba87645296414f340c89b6bd2f556b05f05115
CRs-Fixed: 898565
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index fcdf270..9c8af82 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -14472,6 +14472,12 @@
)
{
int status;
+ u16 channel;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
+ const u8 *bssid_hint = req->bssid_hint;
+#else
+ const u8 *bssid_hint = NULL;
+#endif
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR( ndev );
VOS_STATUS exitbmpsStatus = VOS_STATUS_E_INVAL;
hdd_context_t *pHddCtx = NULL;
@@ -14557,28 +14563,13 @@
return -ECONNREFUSED;
}
- if ( req->channel )
- {
- status = wlan_hdd_cfg80211_connect_start(pAdapter, req->ssid,
- req->ssid_len, req->bssid,
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
- req->bssid_hint,
- #else
- NULL,
- #endif
- req->channel->hw_value);
- }
+ if (req->channel)
+ channel = req->channel->hw_value;
else
- {
- status = wlan_hdd_cfg80211_connect_start(pAdapter, req->ssid,
- req->ssid_len, req->bssid,
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
- req->bssid_hint,
- #else
- NULL,
- #endif
- 0);
- }
+ channel = 0;
+ status = wlan_hdd_cfg80211_connect_start(pAdapter, req->ssid,
+ req->ssid_len, req->bssid,
+ bssid_hint, channel);
if (0 != status)
{