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

wimax/i2400m: 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: David S. Miller <davem@davemloft.net>

authored by

Wei Yongjun and committed by
David S. Miller
9213bb83 8f4cccbb

+1 -2
+1 -2
drivers/net/wimax/i2400m/driver.c
··· 222 222 struct sk_buff *skb; 223 223 const struct i2400m_tlv_detailed_device_info *ddi; 224 224 struct net_device *net_dev = i2400m->wimax_dev.net_dev; 225 - const unsigned char zeromac[ETH_ALEN] = { 0 }; 226 225 227 226 d_fnstart(3, dev, "(i2400m %p)\n", i2400m); 228 227 skb = i2400m_get_device_info(i2400m); ··· 243 244 "to that of boot mode's\n"); 244 245 dev_warn(dev, "device reports %pM\n", ddi->mac_address); 245 246 dev_warn(dev, "boot mode reported %pM\n", net_dev->perm_addr); 246 - if (!memcmp(zeromac, ddi->mac_address, sizeof(zeromac))) 247 + if (is_zero_ether_addr(ddi->mac_address)) 247 248 dev_err(dev, "device reports an invalid MAC address, " 248 249 "not updating\n"); 249 250 else {