Commit f69ba6ab authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

Staging: rtl8187se: 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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cfd75701
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
*/ */
#include <linux/etherdevice.h>
#include "ieee80211.h" #include "ieee80211.h"
/* FIXME: add A freqs */ /* FIXME: add A freqs */
...@@ -131,7 +133,6 @@ int ieee80211_wx_set_wap(struct ieee80211_device *ieee, ...@@ -131,7 +133,6 @@ int ieee80211_wx_set_wap(struct ieee80211_device *ieee,
{ {
int ret = 0; int ret = 0;
u8 zero[] = {0,0,0,0,0,0};
unsigned long flags; unsigned long flags;
short ifup = ieee->proto_started;//dev->flags & IFF_UP; short ifup = ieee->proto_started;//dev->flags & IFF_UP;
...@@ -161,7 +162,7 @@ int ieee80211_wx_set_wap(struct ieee80211_device *ieee, ...@@ -161,7 +162,7 @@ int ieee80211_wx_set_wap(struct ieee80211_device *ieee,
spin_lock_irqsave(&ieee->lock, flags); spin_lock_irqsave(&ieee->lock, flags);
memcpy(ieee->current_network.bssid, temp->sa_data, ETH_ALEN); 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);
//printk(" %x:%x:%x:%x:%x:%x\n", ieee->current_network.bssid[0],ieee->current_network.bssid[1],ieee->current_network.bssid[2],ieee->current_network.bssid[3],ieee->current_network.bssid[4],ieee->current_network.bssid[5]); //printk(" %x:%x:%x:%x:%x:%x\n", ieee->current_network.bssid[0],ieee->current_network.bssid[1],ieee->current_network.bssid[2],ieee->current_network.bssid[3],ieee->current_network.bssid[4],ieee->current_network.bssid[5]);
spin_unlock_irqrestore(&ieee->lock, flags); spin_unlock_irqrestore(&ieee->lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment