diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-08-23 07:19:37 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-04 21:09:01 (GMT) |
commit | f6aa782f255de96b89ff4fc98dad0d57a9691c8a (patch) | |
tree | c32ec86b9d519bb8202321aa059cc64fc58cb2c4 /drivers | |
parent | f69ba6abdae3fc5072175a74759f92af4c26b56f (diff) | |
download | linux-fsl-qoriq-f6aa782f255de96b89ff4fc98dad0d57a9691c8a.tar.xz |
Staging: rtl8192u: use is_zero_ether_addr() instead of memcmp()
Using is_zero_ether_addr() instead of directly use
memcmp() to determine if the ethernet address is all
zeros.
spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c index cb5a3c3..421da8a 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c @@ -14,6 +14,8 @@ */ +#include <linux/etherdevice.h> + #include "ieee80211.h" #include "dot11d.h" /* FIXME: add A freqs */ @@ -136,7 +138,6 @@ int ieee80211_wx_set_wap(struct ieee80211_device *ieee, { int ret = 0; - u8 zero[] = {0,0,0,0,0,0}; unsigned long flags; short ifup = ieee->proto_started;//dev->flags & IFF_UP; @@ -165,7 +166,7 @@ int ieee80211_wx_set_wap(struct ieee80211_device *ieee, spin_lock_irqsave(&ieee->lock, flags); memcpy(ieee->current_network.bssid, temp->sa_data, ETH_ALEN); - ieee->wap_set = memcmp(temp->sa_data, zero,ETH_ALEN)!=0; + ieee->wap_set = !is_zero_ether_addr(temp->sa_data); spin_unlock_irqrestore(&ieee->lock, flags); |