Skip to content

Commit

Permalink
staging: csr: use is_zero_ether_addr() instead of memcmp()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Greg Kroah-Hartman committed Sep 4, 2012
1 parent c8be681 commit 6a5c231
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/staging/csr/sme_wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -1191,8 +1191,6 @@ unifi_siwap(struct net_device *dev, struct iw_request_info *info,
netInterface_priv_t *interfacePriv = (netInterface_priv_t *)netdev_priv(dev);
unifi_priv_t *priv = interfacePriv->privPtr;
int err = 0;
const unsigned char zero_bssid[ETH_ALEN] = {0x00, 0x00, 0x00,
0x00, 0x00, 0x00};

func_enter();

Expand All @@ -1213,7 +1211,7 @@ unifi_siwap(struct net_device *dev, struct iw_request_info *info,
unifi_trace(priv, UDBG1, "unifi_siwap: asked for %pM\n",
wrqu->ap_addr.sa_data);

if (!memcmp(wrqu->ap_addr.sa_data, zero_bssid, ETH_ALEN)) {
if (is_zero_ether_addr(wrqu->ap_addr.sa_data)) {
priv->ignore_bssid_join = FALSE;
err = sme_mgt_disconnect(priv);
if (err) {
Expand Down

0 comments on commit 6a5c231

Please sign in to comment.