提交 61d23e9f 编写于 作者: D dingtianhong 提交者: David S. Miller

net: benet: slight optimization of addr compare

Use possibly more efficient ether_addr_equal
to instead of memcmp.

Cc: Sathya Perla <sathya.perla@emulex.com>
Cc: Subbu Seetharaman <subbu.seetharaman@emulex.com>
Cc: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: NDing Tianhong <dingtianhong@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 9130ac61
......@@ -287,7 +287,7 @@ static int be_mac_addr_set(struct net_device *netdev, void *p)
/* The MAC change did not happen, either due to lack of privilege
* or PF didn't pre-provision.
*/
if (memcmp(addr->sa_data, mac, ETH_ALEN)) {
if (!ether_addr_equal(addr->sa_data, mac)) {
status = -EPERM;
goto err;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册