Skip to content

Commit

Permalink
caif_usb: Use ether_addr_copy
Browse files Browse the repository at this point in the history
Use ether_addr_copy instead of memcpy(a, b, ETH_ALEN) to
save some cycles on arm and powerpc.

Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
JoePerches authored and davem330 committed Jan 22, 2014
1 parent 116e853 commit 34b2cff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/caif/caif_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ static struct cflayer *cfusbl_create(int phyid, u8 ethaddr[ETH_ALEN],
* 5-11 source address
* 12-13 protocol type
*/
memcpy(&this->tx_eth_hdr[ETH_ALEN], braddr, ETH_ALEN);
memcpy(&this->tx_eth_hdr[ETH_ALEN], ethaddr, ETH_ALEN);
ether_addr_copy(&this->tx_eth_hdr[ETH_ALEN], braddr);
ether_addr_copy(&this->tx_eth_hdr[ETH_ALEN], ethaddr);
this->tx_eth_hdr[12] = cpu_to_be16(ETH_P_802_EX1) & 0xff;
this->tx_eth_hdr[13] = (cpu_to_be16(ETH_P_802_EX1) >> 8) & 0xff;
pr_debug("caif ethernet TX-header dst:%pM src:%pM type:%02x%02x\n",
Expand Down

0 comments on commit 34b2cff

Please sign in to comment.