Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: csr: 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>

authored by

Wei Yongjun and committed by
Greg Kroah-Hartman
6a5c2319 c8be681f

+1 -3
+1 -3
drivers/staging/csr/sme_wext.c
··· 1191 1191 netInterface_priv_t *interfacePriv = (netInterface_priv_t *)netdev_priv(dev); 1192 1192 unifi_priv_t *priv = interfacePriv->privPtr; 1193 1193 int err = 0; 1194 - const unsigned char zero_bssid[ETH_ALEN] = {0x00, 0x00, 0x00, 1195 - 0x00, 0x00, 0x00}; 1196 1194 1197 1195 func_enter(); 1198 1196 ··· 1211 1213 unifi_trace(priv, UDBG1, "unifi_siwap: asked for %pM\n", 1212 1214 wrqu->ap_addr.sa_data); 1213 1215 1214 - if (!memcmp(wrqu->ap_addr.sa_data, zero_bssid, ETH_ALEN)) { 1216 + if (is_zero_ether_addr(wrqu->ap_addr.sa_data)) { 1215 1217 priv->ignore_bssid_join = FALSE; 1216 1218 err = sme_mgt_disconnect(priv); 1217 1219 if (err) {