summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8188eu
diff options
context:
space:
mode:
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>2015-03-04 08:56:45 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-06 15:30:07 -0800
commit8e5d9433412d34f02a83edd265605bfe6c347a0a (patch)
tree0d7ab49c74c5593c037ecc61758c6ded69051f7e /drivers/staging/rtl8188eu
parenta06487242467aa9511470f1f92184ae1a9149d37 (diff)
downloadop-kernel-dev-8e5d9433412d34f02a83edd265605bfe6c347a0a.zip
op-kernel-dev-8e5d9433412d34f02a83edd265605bfe6c347a0a.tar.gz
staging: rtl8188eu: replace memset(x,0,ETH_ALEN)
eth_zero_addr() is a wrapper function for memset if 0 is going to be assigned to a mac address. The aforementioned function replaces memset. In addition, linux/etherdevice.h was included as a header since it is the file that define the inline function eth_zero_addr(). The changes were carried out using the following coccinelle script: @header@ @@ #include <linux/etherdevice.h> @eth_zero_addr@ expression e; @@ -memset(e,0,ETH_ALEN); +eth_zero_addr(e); @eth_broadcast_addr@ identifier e; @@ -memset(e,\(0xff\|0xFF\|255\),ETH_ALEN); +eth_broadcast_addr(e); @linux_header depends on !header && (eth_zero_addr || eth_broadcast_addr) @ @@ + #include <linux/etherdevice.h> + @special_header depends on !header && !linux_header && (eth_zero_addr || eth_broadcast_addr) @ @@ + + #include <linux/etherdevice.h> + @custom_header depends on !header && !linux_header && !special_header && (eth_zero_addr || eth_broadcast_addr) @ @@ + + #include <linux/etherdevice.h> Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu')
-rw-r--r--drivers/staging/rtl8188eu/os_dep/ioctl_linux.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
index 58998f2..96c1c2d 100644
--- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
@@ -32,6 +32,8 @@
#include <rtw_iol.h>
#include <linux/vmalloc.h>
+#include <linux/etherdevice.h>
+
#include "osdep_intf.h"
#define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV + 30)
@@ -92,7 +94,7 @@ void rtw_indicate_wx_disassoc_event(struct adapter *padapter)
memset(&wrqu, 0, sizeof(union iwreq_data));
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
- memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);
+ eth_zero_addr(wrqu.ap_addr.sa_data);
DBG_88E_LEVEL(_drv_always_, "indicate disassoc\n");
wireless_send_event(padapter->pnetdev, SIOCGIWAP, &wrqu, NULL);
@@ -827,7 +829,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
for (j = 0; j < NUM_PMKID_CACHE; j++) {
if (!memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN)) {
/* BSSID is matched, the same AP => Remove this PMKID information and reset it. */
- memset(psecuritypriv->PMKIDList[j].Bssid, 0x00, ETH_ALEN);
+ eth_zero_addr(psecuritypriv->PMKIDList[j].Bssid);
psecuritypriv->PMKIDList[j].bUsed = false;
break;
}
@@ -1028,7 +1030,7 @@ static int rtw_wx_get_wap(struct net_device *dev,
wrqu->ap_addr.sa_family = ARPHRD_ETHER;
- memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN);
+ eth_zero_addr(wrqu->ap_addr.sa_data);
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_wap\n"));
@@ -1037,7 +1039,7 @@ static int rtw_wx_get_wap(struct net_device *dev,
((check_fwstate(pmlmepriv, WIFI_AP_STATE)) == true))
memcpy(wrqu->ap_addr.sa_data, pcur_bss->MacAddress, ETH_ALEN);
else
- memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN);
+ eth_zero_addr(wrqu->ap_addr.sa_data);
return 0;
}
OpenPOWER on IntegriCloud