summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8192e
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2012-08-23 16:50:12 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-04 14:09:01 -0700
commitefe13d868f3475ae7c296fff02f10c84dd80d45c (patch)
tree4eb9787e975ae013f9b39c06c6e969e8a385567d /drivers/staging/rtl8192e
parentf6aa782f255de96b89ff4fc98dad0d57a9691c8a (diff)
downloadblackbird-obmc-linux-efe13d868f3475ae7c296fff02f10c84dd80d45c.tar.gz
blackbird-obmc-linux-efe13d868f3475ae7c296fff02f10c84dd80d45c.zip
staging: rtl8192e: 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/staging/rtl8192e')
-rw-r--r--drivers/staging/rtl8192e/rtllib_softmac_wx.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
index 1bb6b52e0f24..740cf85e9d5b 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
@@ -14,6 +14,8 @@
*/
+#include <linux/etherdevice.h>
+
#include "rtllib.h"
#include "dot11d.h"
/* FIXME: add A freqs */
@@ -137,7 +139,6 @@ int rtllib_wx_set_wap(struct rtllib_device *ieee,
{
int ret = 0;
- u8 zero[] = {0, 0, 0, 0, 0, 0};
unsigned long flags;
short ifup = ieee->proto_started;
@@ -157,7 +158,7 @@ int rtllib_wx_set_wap(struct rtllib_device *ieee,
goto out;
}
- if (memcmp(temp->sa_data, zero, ETH_ALEN) == 0) {
+ if (is_zero_ether_addr(temp->sa_data)) {
spin_lock_irqsave(&ieee->lock, flags);
memcpy(ieee->current_network.bssid, temp->sa_data, ETH_ALEN);
ieee->wap_set = 0;
@@ -177,7 +178,7 @@ int rtllib_wx_set_wap(struct rtllib_device *ieee,
ieee->cannot_notify = false;
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);
OpenPOWER on IntegriCloud