diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-08-24 13:29:09 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-04 14:09:02 -0700 |
commit | 3cd84fbd667d1dd01209b8c30a3a8525e8a99e63 (patch) | |
tree | b185708fb32b96458a25779b577e54c58e6f7f78 /drivers/staging/rtl8712 | |
parent | efe13d868f3475ae7c296fff02f10c84dd80d45c (diff) | |
download | linux-3cd84fbd667d1dd01209b8c30a3a8525e8a99e63.tar.bz2 |
staging: r8712u: rtl871x_mlme.c: 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>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712')
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_mlme.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c index dc7adc132d12..c51ad9ed4b52 100644 --- a/drivers/staging/rtl8712/rtl871x_mlme.c +++ b/drivers/staging/rtl8712/rtl871x_mlme.c @@ -28,6 +28,8 @@ #define _RTL871X_MLME_C_ +#include <linux/etherdevice.h> + #include "osdep_service.h" #include "drv_types.h" #include "recv_osdep.h" @@ -146,9 +148,8 @@ static struct wlan_network *_r8712_find_network(struct __queue *scanned_queue, unsigned long irqL; struct list_head *phead, *plist; struct wlan_network *pnetwork = NULL; - u8 zero_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0}; - if (!memcmp(zero_addr, addr, ETH_ALEN)) + if (is_zero_ether_addr(addr)) return NULL; spin_lock_irqsave(&scanned_queue->lock, irqL); phead = get_list_head(scanned_queue); |