diff options
author | Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> | 2015-03-03 16:06:19 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-06 09:54:34 -0800 |
commit | 21f5690ec7f5a5fa278f2b818a7ed722becd6995 (patch) | |
tree | 68862ecefaa7d461e0043c9c889290642239ad70 /drivers | |
parent | 76f73693ca36a13aff719c71236c47a4927c14a0 (diff) | |
download | talos-obmc-linux-21f5690ec7f5a5fa278f2b818a7ed722becd6995.tar.gz talos-obmc-linux-21f5690ec7f5a5fa278f2b818a7ed722becd6995.zip |
staging: rtl8192u: replace memset(x,0,ETH_ALEN) by eth_zero_addr(x)
eth_zero_addr() is a wrapper function for memset if 0 is going to
be assigned to a mac address. The replacement was done by 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')
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index 3a5407158963..3527edc39064 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -3208,7 +3208,7 @@ void notify_wx_assoc_event(struct ieee80211_device *ieee) if (ieee->state == IEEE80211_LINKED) memcpy(wrqu.ap_addr.sa_data, ieee->current_network.bssid, ETH_ALEN); else - memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN); + eth_zero_addr(wrqu.ap_addr.sa_data); wireless_send_event(ieee->dev, SIOCGIWAP, &wrqu, NULL); } EXPORT_SYMBOL(notify_wx_assoc_event); |