rtl8712: remove useless calls to memset().
authorCyril Roelandt <tipecaml@gmail.com>
Sun, 2 Dec 2012 02:40:21 +0000 (03:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Jan 2013 00:37:11 +0000 (16:37 -0800)
These calls are followed by calls to memcpy() on the same memory area, so they
can be safely removed.

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/mlme_linux.c
drivers/staging/rtl8712/rtl871x_cmd.c
drivers/staging/rtl8712/rtl871x_ioctl_set.c
drivers/staging/rtl8712/rtl871x_mlme.c

index 7279854c86aa4e1dccccbd6d363d6ab3c28bec79..f569a7081be599ddd645fb55f928a3067340a9f7 100644 (file)
@@ -106,8 +106,6 @@ void r8712_os_indicate_disconnect(struct _adapter *adapter)
                 * disconnect with AP for 60 seconds.
                 */
 
-               memset(&backupPMKIDList[0], 0x00, sizeof(
-                       struct RT_PMKID_LIST) * NUM_PMKID_CACHE);
                memcpy(&backupPMKIDList[0], &adapter->securitypriv.
                        PMKIDList[0], sizeof(struct RT_PMKID_LIST) *
                        NUM_PMKID_CACHE);
index 31f31dbf7f3166654c068ca83c46dcc2d287d3e9..f16307f5d827e72707996c1299c8636e3448e000 100644 (file)
@@ -525,7 +525,6 @@ u8 r8712_joinbss_cmd(struct _adapter  *padapter, struct wlan_network *pnetwork)
                kfree(pcmd);
                return _FAIL;
        }
-       memset(psecnetwork, 0, t_len);
        memcpy(psecnetwork, &pnetwork->network, t_len);
        auth = &psecuritypriv->authenticator_ie[0];
        psecuritypriv->authenticator_ie[0] = (unsigned char)
index d3ab24e34e3d704d60bcebf1c7308b1a5195a10f..53a7c8c1bb40184d12e539a78cd9503b2f1a1af2 100644 (file)
@@ -97,8 +97,6 @@ static u8 do_join(struct _adapter *padapter)
                                pmlmepriv->fw_state = WIFI_ADHOC_MASTER_STATE;
                                pibss = padapter->registrypriv.dev_network.
                                        MacAddress;
-                               memset(&pdev_network->Ssid, 0,
-                                       sizeof(struct ndis_802_11_ssid));
                                memcpy(&pdev_network->Ssid,
                                        &pmlmepriv->assoc_ssid,
                                        sizeof(struct ndis_802_11_ssid));
index c51ad9ed4b52372144895cf48b003a3c5746050b..e52f04d57df3ad6ccfd4b5ff8ddde92a4e96d0f4 100644 (file)
@@ -604,9 +604,6 @@ void r8712_surveydone_event_callback(struct _adapter *adapter, u8 *pbuf)
                                                 adapter->registrypriv.
                                                        dev_network.MacAddress;
                                        pmlmepriv->fw_state ^= _FW_UNDER_SURVEY;
-                                       memset(&pdev_network->Ssid, 0,
-                                               sizeof(struct
-                                                      ndis_802_11_ssid));
                                        memcpy(&pdev_network->Ssid,
                                                &pmlmepriv->assoc_ssid,
                                                sizeof(struct
@@ -1006,8 +1003,6 @@ void r8712_stadel_event_callback(struct _adapter *adapter, u8 *pbuf)
                        memcpy(pdev_network, &tgt_network->network,
                                r8712_get_ndis_wlan_bssid_ex_sz(&tgt_network->
                                                        network));
-                       memset(&pdev_network->Ssid, 0,
-                               sizeof(struct ndis_802_11_ssid));
                        memcpy(&pdev_network->Ssid,
                                &pmlmepriv->assoc_ssid,
                                sizeof(struct ndis_802_11_ssid));