]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
net: benet: slight optimization of addr compare
authordingtianhong <dingtianhong@huawei.com>
Mon, 30 Dec 2013 07:40:43 +0000 (15:40 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 Dec 2013 21:48:31 +0000 (16:48 -0500)
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: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_main.c

index f67586a766d26e9c4eba9a42e61fdd1f3b73993f..b5c238aa6861374f7888988887fab68d46b79618 100644 (file)
@@ -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;
        }