Skip to content

Commit

Permalink
staging: rtl8188eu: core: Remove redundant memset before memcpy
Browse files Browse the repository at this point in the history
The region set by the call to memset, immediately overwritten by the
subsequent call to memcpy makes the memset redundant.

This patch removes the redundant memset before memcpy using the
following coccinelle script:

@@
expression e1,e2,e3,e4;
@@

- memset(e1,e2,e3);
  memcpy(e1,e4,e3);

Signed-off-by: Tapasweni Pathak <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
tapaswenipathak authored and gregkh committed Oct 28, 2014
1 parent c650ba7 commit a707edd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ u8 rtw_do_join(struct adapter *padapter)

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));

rtw_update_registrypriv_dev_network(padapter);
Expand Down
2 changes: 0 additions & 2 deletions drivers/staging/rtl8188eu/core/rtw_mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,6 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)

RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("switching to adhoc master\n"));

memset(&pdev_network->Ssid, 0, sizeof(struct ndis_802_11_ssid));
memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(struct ndis_802_11_ssid));

rtw_update_registrypriv_dev_network(adapter);
Expand Down Expand Up @@ -1334,7 +1333,6 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)

memcpy(pdev_network, &tgt_network->network, get_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));

rtw_update_registrypriv_dev_network(adapter);
Expand Down

0 comments on commit a707edd

Please sign in to comment.