bonding: More use of ether_addr_copy
authorJoe Perches <joe@perches.com>
Tue, 18 Feb 2014 17:42:45 +0000 (09:42 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Feb 2014 20:37:51 +0000 (15:37 -0500)
It's smaller and faster for some architectures.

Signed-off-by: Joe Perches <joe@perches.com>
Reviewed-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_3ad.c
drivers/net/bonding/bond_alb.c
drivers/net/bonding/bond_main.c

index e362ff720e6b600bcb5850fe9d170d03728de55d..87348411bafec613c8de2f9b32faaf8608c9f62a 100644 (file)
@@ -2384,8 +2384,8 @@ int __bond_3ad_get_active_agg_info(struct bonding *bond,
                ad_info->ports = aggregator->num_of_ports;
                ad_info->actor_key = aggregator->actor_oper_aggregator_key;
                ad_info->partner_key = aggregator->partner_oper_aggregator_key;
-               memcpy(ad_info->partner_system,
-                      aggregator->partner_system.mac_addr_value, ETH_ALEN);
+               ether_addr_copy(ad_info->partner_system,
+                               aggregator->partner_system.mac_addr_value);
                return 0;
        }
 
index 538913e627157320fa0dddd319a0329b1b83853c..97a43a20dae8771c13482894d76767629cfc9fba 100644 (file)
@@ -1449,9 +1449,8 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
 
        if (tx_slave && SLAVE_IS_OK(tx_slave)) {
                if (tx_slave != rcu_dereference(bond->curr_active_slave)) {
-                       memcpy(eth_data->h_source,
-                              tx_slave->dev->dev_addr,
-                              ETH_ALEN);
+                       ether_addr_copy(eth_data->h_source,
+                                       tx_slave->dev->dev_addr);
                }
 
                bond_dev_queue_xmit(bond, skb, tx_slave->dev);
index afae7cab5cf64d376127ae905317a23e4c275383..71edf03544aab97ebaab2116830c67a30553032e 100644 (file)
@@ -674,8 +674,8 @@ static void bond_do_fail_over_mac(struct bonding *bond,
 
                if (old_active) {
                        ether_addr_copy(tmp_mac, new_active->dev->dev_addr);
-                       memcpy(saddr.sa_data, old_active->dev->dev_addr,
-                              ETH_ALEN);
+                       ether_addr_copy(saddr.sa_data,
+                                       old_active->dev->dev_addr);
                        saddr.sa_family = new_active->dev->type;
                } else {
                        ether_addr_copy(saddr.sa_data, bond->dev->dev_addr);
@@ -1139,7 +1139,7 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
                        kfree_skb(skb);
                        return RX_HANDLER_CONSUMED;
                }
-               memcpy(eth_hdr(skb)->h_dest, bond->dev->dev_addr, ETH_ALEN);
+               ether_addr_copy(eth_hdr(skb)->h_dest, bond->dev->dev_addr);
        }
 
        return ret;