staging: rtl8723au: cfg80211_rtw_connect(): Simplify ssid preparation
authorJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 9 Jun 2014 13:16:42 +0000 (15:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jun 2014 21:00:20 +0000 (14:00 -0700)
Since we just matched sme->{ssid,ssid_len} to
pnetwork->network.Ssid.{ssid,ssid_len} we can simplify the copy and
move it to just before the call to rtw_set_ssid().

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c

index 281b48c590fe82e80a0e74d1cda2669915209e01..0a6922d6a1195dbe5c7412727805e58e042473c0 100644 (file)
@@ -2188,10 +2188,6 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
                                             sme->bssid)) {
                                DBG_8723A("matched by bssid\n");
 
-                               memcpy(ssid.ssid, pnetwork->network.Ssid.ssid,
-                                      pnetwork->network.Ssid.ssid_len);
-                               ssid.ssid_len = pnetwork->network.Ssid.ssid_len;
-
                                matched = true;
                                break;
                        }
@@ -2201,9 +2197,6 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
                            pnetwork->network.Ssid.ssid_len == sme->ssid_len) {
                                DBG_8723A("matched by ssid\n");
 
-                               memcpy(ssid.ssid, sme->ssid, sme->ssid_len);
-                               ssid.ssid_len = sme->ssid_len;
-
                                matched = true;
                                break;
                        }
@@ -2322,6 +2315,10 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
        /* rtw_set_802_11_encryption_mode(padapter,
           padapter->securitypriv.ndisencryptstatus); */
 
+       memcpy(ssid.ssid, pnetwork->network.Ssid.ssid,
+              pnetwork->network.Ssid.ssid_len);
+       ssid.ssid_len = pnetwork->network.Ssid.ssid_len;
+
        if (rtw_set_ssid(padapter, &ssid) != _SUCCESS) {
                ret = -EBUSY;
                goto exit;