From 6bd8a2e02b08137bf3c2a29abdf38387a6bd5ca2 Mon Sep 17 00:00:00 2001 From: Sreelakshmi Konamki Date: Tue, 3 Nov 2015 16:30:32 +0530 Subject: [PATCH] qcacld-3.0: Remove redundant code in __wlan_hdd_cfg80211_connect() qcacld-2.0 to qcacld-3.0 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 --- core/hdd/src/wlan_hdd_cfg80211.c | 38 +++++++++++--------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index e2b4d893ce56..9332e403d936 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -8288,6 +8288,12 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy, struct cfg80211_connect_params *req) { 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); hdd_context_t *pHddCtx; @@ -8359,31 +8365,13 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy, return status; } - 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)) || \ - defined(CFG80211_BSSID_HINT_BACKPORT) - req->bssid_hint, -#else - NULL, -#endif - 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)) || \ - defined(CFG80211_BSSID_HINT_BACKPORT) - req->bssid_hint, -#else - NULL, -#endif - 0); - } - + if (req->channel) + channel = req->channel->hw_value; + else + channel = 0; + status = wlan_hdd_cfg80211_connect_start(pAdapter, req->ssid, + req->ssid_len, req->bssid, + bssid_hint, channel); if (0 > status) { hddLog(LOGE, FL("connect failed")); return status;