From: dingtianhong Date: Mon, 30 Dec 2013 07:40:43 +0000 (+0800) Subject: net: benet: slight optimization of addr compare X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=61d23e9f3d60347dd05475b35a7837f4e7fcbd7a;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git net: benet: slight optimization of addr compare Use possibly more efficient ether_addr_equal to instead of memcmp. Cc: Sathya Perla Cc: Subbu Seetharaman Cc: Ajit Khaparde Signed-off-by: Ding Tianhong Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index f67586a766d2..b5c238aa6861 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c @@ -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; }