mirror of https://gitee.com/openkylin/linux.git
Staging: drop redundant memset
The region set by the call to memset is immediately overwritten by the subsequent call to memcpy. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression e1,e2,e3,e4; @@ - memset(e1,e2,e3); memcpy(e1,e4,e3); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
347fd7dbdb
commit
8f18604e6f
|
@ -1596,7 +1596,6 @@ BOOLEAN StaAddMacTableEntry(struct rt_rtmp_adapter *pAd,
|
||||||
union iwreq_data wrqu;
|
union iwreq_data wrqu;
|
||||||
wext_notify_event_assoc(pAd);
|
wext_notify_event_assoc(pAd);
|
||||||
|
|
||||||
memset(wrqu.ap_addr.sa_data, 0, MAC_ADDR_LEN);
|
|
||||||
memcpy(wrqu.ap_addr.sa_data, pAd->MlmeAux.Bssid, MAC_ADDR_LEN);
|
memcpy(wrqu.ap_addr.sa_data, pAd->MlmeAux.Bssid, MAC_ADDR_LEN);
|
||||||
wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
|
wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
|
||||||
|
|
||||||
|
|
|
@ -608,7 +608,6 @@ int rt_ioctl_siwap(struct net_device *dev,
|
||||||
/* Prevent to connect AP again in STAMlmePeriodicExec */
|
/* Prevent to connect AP again in STAMlmePeriodicExec */
|
||||||
pAdapter->MlmeAux.AutoReconnectSsidLen = 32;
|
pAdapter->MlmeAux.AutoReconnectSsidLen = 32;
|
||||||
|
|
||||||
memset(Bssid, 0, MAC_ADDR_LEN);
|
|
||||||
memcpy(Bssid, ap_addr->sa_data, MAC_ADDR_LEN);
|
memcpy(Bssid, ap_addr->sa_data, MAC_ADDR_LEN);
|
||||||
MlmeEnqueue(pAdapter,
|
MlmeEnqueue(pAdapter,
|
||||||
MLME_CNTL_STATE_MACHINE,
|
MLME_CNTL_STATE_MACHINE,
|
||||||
|
|
|
@ -33,7 +33,6 @@ bool SendTxCommandPacket(struct net_device *dev, void *pData, u32 DataLen)
|
||||||
tcb_desc->bLastIniPkt = 0;
|
tcb_desc->bLastIniPkt = 0;
|
||||||
skb_reserve(skb, USB_HWDESC_HEADER_LEN);
|
skb_reserve(skb, USB_HWDESC_HEADER_LEN);
|
||||||
ptr_buf = skb_put(skb, DataLen);
|
ptr_buf = skb_put(skb, DataLen);
|
||||||
memset(ptr_buf, 0, DataLen);
|
|
||||||
memcpy(ptr_buf, pData, DataLen);
|
memcpy(ptr_buf, pData, DataLen);
|
||||||
tcb_desc->txbuf_size = (u16)DataLen;
|
tcb_desc->txbuf_size = (u16)DataLen;
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,6 @@ SendTxCommandPacket(
|
||||||
tcb_desc->bLastIniPkt = 0;
|
tcb_desc->bLastIniPkt = 0;
|
||||||
skb_reserve(skb, USB_HWDESC_HEADER_LEN);
|
skb_reserve(skb, USB_HWDESC_HEADER_LEN);
|
||||||
ptr_buf = skb_put(skb, DataLen);
|
ptr_buf = skb_put(skb, DataLen);
|
||||||
memset(ptr_buf,0,DataLen);
|
|
||||||
memcpy(ptr_buf,pData,DataLen);
|
memcpy(ptr_buf,pData,DataLen);
|
||||||
tcb_desc->txbuf_size= (u16)DataLen;
|
tcb_desc->txbuf_size= (u16)DataLen;
|
||||||
|
|
||||||
|
|
|
@ -699,7 +699,6 @@ if (pMgmt->eScanState == WMAC_IS_SCANNING) {
|
||||||
if (wrq->sa_family != ARPHRD_ETHER)
|
if (wrq->sa_family != ARPHRD_ETHER)
|
||||||
rc = -EINVAL;
|
rc = -EINVAL;
|
||||||
else {
|
else {
|
||||||
memset(pMgmt->abyDesireBSSID, 0xFF, 6);
|
|
||||||
memcpy(pMgmt->abyDesireBSSID, wrq->sa_data, 6);
|
memcpy(pMgmt->abyDesireBSSID, wrq->sa_data, 6);
|
||||||
//2008-0409-05, <Add> by Einsn Liu
|
//2008-0409-05, <Add> by Einsn Liu
|
||||||
if((pDevice->bLinkPass == TRUE) &&
|
if((pDevice->bLinkPass == TRUE) &&
|
||||||
|
@ -889,7 +888,6 @@ if (pMgmt->eScanState == WMAC_IS_SCANNING) {
|
||||||
BYTE abyTmpDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
|
BYTE abyTmpDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
|
||||||
UINT ii , uSameBssidNum=0;
|
UINT ii , uSameBssidNum=0;
|
||||||
|
|
||||||
memset(abyTmpDesireSSID,0,sizeof(abyTmpDesireSSID));
|
|
||||||
memcpy(abyTmpDesireSSID,pMgmt->abyDesireSSID,sizeof(abyTmpDesireSSID));
|
memcpy(abyTmpDesireSSID,pMgmt->abyDesireSSID,sizeof(abyTmpDesireSSID));
|
||||||
pCurr = BSSpSearchBSSList(pDevice,
|
pCurr = BSSpSearchBSSList(pDevice,
|
||||||
NULL,
|
NULL,
|
||||||
|
|
|
@ -758,7 +758,6 @@ int iwctl_siwap(struct net_device *dev,
|
||||||
if (wrq->sa_family != ARPHRD_ETHER)
|
if (wrq->sa_family != ARPHRD_ETHER)
|
||||||
rc = -EINVAL;
|
rc = -EINVAL;
|
||||||
else {
|
else {
|
||||||
memset(pMgmt->abyDesireBSSID, 0xFF, 6);
|
|
||||||
memcpy(pMgmt->abyDesireBSSID, wrq->sa_data, 6);
|
memcpy(pMgmt->abyDesireBSSID, wrq->sa_data, 6);
|
||||||
|
|
||||||
//mike :add
|
//mike :add
|
||||||
|
@ -936,7 +935,6 @@ int iwctl_siwessid(struct net_device *dev,
|
||||||
BYTE abyTmpDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
|
BYTE abyTmpDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
|
||||||
UINT ii , uSameBssidNum=0;
|
UINT ii , uSameBssidNum=0;
|
||||||
|
|
||||||
memset(abyTmpDesireSSID,0,sizeof(abyTmpDesireSSID));
|
|
||||||
memcpy(abyTmpDesireSSID,pMgmt->abyDesireSSID,sizeof(abyTmpDesireSSID));
|
memcpy(abyTmpDesireSSID,pMgmt->abyDesireSSID,sizeof(abyTmpDesireSSID));
|
||||||
pCurr = BSSpSearchBSSList(pDevice,
|
pCurr = BSSpSearchBSSList(pDevice,
|
||||||
NULL,
|
NULL,
|
||||||
|
|
Loading…
Reference in New Issue