aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-01-20 12:52:16 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-21 21:13:04 -0500
commit116e853f7f1548de3c1aed3181781788be42b99a (patch)
treedaf5ebbb0b794d9c93ec7ca74c50da7b64a48d5f
parent90ccb6aa407a906886b0d372996e71c4ee78eeca (diff)
atm: Use ether_addr_copy
Use ether_addr_copy instead of memcpy(a, b, ETH_ALEN) to save some cycles on arm and powerpc. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/atm/lec.c9
-rw-r--r--net/atm/mpc.c2
2 files changed, 6 insertions, 5 deletions
diff --git a/net/atm/lec.c b/net/atm/lec.c
index f23916be18fb..0b73ae9a1040 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -521,7 +521,7 @@ send_to_lecd(struct lec_priv *priv, atmlec_msg_type type,
521 if (data != NULL) 521 if (data != NULL)
522 mesg->sizeoftlvs = data->len; 522 mesg->sizeoftlvs = data->len;
523 if (mac_addr) 523 if (mac_addr)
524 memcpy(&mesg->content.normal.mac_addr, mac_addr, ETH_ALEN); 524 ether_addr_copy(&mesg->content.normal.mac_addr, mac_addr);
525 else 525 else
526 mesg->content.normal.targetless_le_arp = 1; 526 mesg->content.normal.targetless_le_arp = 1;
527 if (atm_addr) 527 if (atm_addr)
@@ -1565,7 +1565,7 @@ static struct lec_arp_table *make_entry(struct lec_priv *priv,
1565 pr_info("LEC: Arp entry kmalloc failed\n"); 1565 pr_info("LEC: Arp entry kmalloc failed\n");
1566 return NULL; 1566 return NULL;
1567 } 1567 }
1568 memcpy(to_return->mac_addr, mac_addr, ETH_ALEN); 1568 ether_addr_copy(to_return->mac_addr, mac_addr);
1569 INIT_HLIST_NODE(&to_return->next); 1569 INIT_HLIST_NODE(&to_return->next);
1570 setup_timer(&to_return->timer, lec_arp_expire_arp, 1570 setup_timer(&to_return->timer, lec_arp_expire_arp,
1571 (unsigned long)to_return); 1571 (unsigned long)to_return);
@@ -1887,7 +1887,8 @@ lec_arp_update(struct lec_priv *priv, const unsigned char *mac_addr,
1887 entry = tmp; 1887 entry = tmp;
1888 } else { 1888 } else {
1889 entry->status = ESI_FORWARD_DIRECT; 1889 entry->status = ESI_FORWARD_DIRECT;
1890 memcpy(entry->mac_addr, mac_addr, ETH_ALEN); 1890 ether_addr_copy(entry->mac_addr,
1891 mac_addr);
1891 entry->last_used = jiffies; 1892 entry->last_used = jiffies;
1892 lec_arp_add(priv, entry); 1893 lec_arp_add(priv, entry);
1893 } 1894 }
@@ -2263,7 +2264,7 @@ lec_arp_check_empties(struct lec_priv *priv,
2263 &priv->lec_arp_empty_ones, next) { 2264 &priv->lec_arp_empty_ones, next) {
2264 if (vcc == entry->vcc) { 2265 if (vcc == entry->vcc) {
2265 del_timer(&entry->timer); 2266 del_timer(&entry->timer);
2266 memcpy(entry->mac_addr, src, ETH_ALEN); 2267 ether_addr_copy(entry->mac_addr, src);
2267 entry->status = ESI_FORWARD_DIRECT; 2268 entry->status = ESI_FORWARD_DIRECT;
2268 entry->last_used = jiffies; 2269 entry->last_used = jiffies;
2269 /* We might have got an entry */ 2270 /* We might have got an entry */
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 3af12755cd04..b71ff6b234f2 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -478,7 +478,7 @@ static const uint8_t *copy_macs(struct mpoa_client *mpc,
478 return NULL; 478 return NULL;
479 } 479 }
480 } 480 }
481 memcpy(mpc->mps_macs, router_mac, ETH_ALEN); 481 ether_addr_copy(mpc->mps_macs, router_mac);
482 tlvs += 20; if (device_type == MPS_AND_MPC) tlvs += 20; 482 tlvs += 20; if (device_type == MPS_AND_MPC) tlvs += 20;
483 if (mps_macs > 0) 483 if (mps_macs > 0)
484 memcpy(mpc->mps_macs, tlvs, mps_macs*ETH_ALEN); 484 memcpy(mpc->mps_macs, tlvs, mps_macs*ETH_ALEN);