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>
This commit is contained in:
Joe Perches 2014-01-20 09:52:16 -08:00 committed by David S. Miller
parent 90ccb6aa40
commit 116e853f7f
2 changed files with 6 additions and 5 deletions

View File

@ -521,7 +521,7 @@ send_to_lecd(struct lec_priv *priv, atmlec_msg_type type,
if (data != NULL) if (data != NULL)
mesg->sizeoftlvs = data->len; mesg->sizeoftlvs = data->len;
if (mac_addr) if (mac_addr)
memcpy(&mesg->content.normal.mac_addr, mac_addr, ETH_ALEN); ether_addr_copy(&mesg->content.normal.mac_addr, mac_addr);
else else
mesg->content.normal.targetless_le_arp = 1; mesg->content.normal.targetless_le_arp = 1;
if (atm_addr) if (atm_addr)
@ -1565,7 +1565,7 @@ static struct lec_arp_table *make_entry(struct lec_priv *priv,
pr_info("LEC: Arp entry kmalloc failed\n"); pr_info("LEC: Arp entry kmalloc failed\n");
return NULL; return NULL;
} }
memcpy(to_return->mac_addr, mac_addr, ETH_ALEN); ether_addr_copy(to_return->mac_addr, mac_addr);
INIT_HLIST_NODE(&to_return->next); INIT_HLIST_NODE(&to_return->next);
setup_timer(&to_return->timer, lec_arp_expire_arp, setup_timer(&to_return->timer, lec_arp_expire_arp,
(unsigned long)to_return); (unsigned long)to_return);
@ -1887,7 +1887,8 @@ lec_arp_update(struct lec_priv *priv, const unsigned char *mac_addr,
entry = tmp; entry = tmp;
} else { } else {
entry->status = ESI_FORWARD_DIRECT; entry->status = ESI_FORWARD_DIRECT;
memcpy(entry->mac_addr, mac_addr, ETH_ALEN); ether_addr_copy(entry->mac_addr,
mac_addr);
entry->last_used = jiffies; entry->last_used = jiffies;
lec_arp_add(priv, entry); lec_arp_add(priv, entry);
} }
@ -2263,7 +2264,7 @@ lec_arp_check_empties(struct lec_priv *priv,
&priv->lec_arp_empty_ones, next) { &priv->lec_arp_empty_ones, next) {
if (vcc == entry->vcc) { if (vcc == entry->vcc) {
del_timer(&entry->timer); del_timer(&entry->timer);
memcpy(entry->mac_addr, src, ETH_ALEN); ether_addr_copy(entry->mac_addr, src);
entry->status = ESI_FORWARD_DIRECT; entry->status = ESI_FORWARD_DIRECT;
entry->last_used = jiffies; entry->last_used = jiffies;
/* We might have got an entry */ /* We might have got an entry */

View File

@ -478,7 +478,7 @@ static const uint8_t *copy_macs(struct mpoa_client *mpc,
return NULL; return NULL;
} }
} }
memcpy(mpc->mps_macs, router_mac, ETH_ALEN); ether_addr_copy(mpc->mps_macs, router_mac);
tlvs += 20; if (device_type == MPS_AND_MPC) tlvs += 20; tlvs += 20; if (device_type == MPS_AND_MPC) tlvs += 20;
if (mps_macs > 0) if (mps_macs > 0)
memcpy(mpc->mps_macs, tlvs, mps_macs*ETH_ALEN); memcpy(mpc->mps_macs, tlvs, mps_macs*ETH_ALEN);