Skip to content

Commit 34b2cff

Browse files
JoePerchesdavem330
authored andcommitted
caif_usb: 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>
1 parent 116e853 commit 34b2cff

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎net/caif/caif_usb.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ static struct cflayer *cfusbl_create(int phyid, u8 ethaddr[ETH_ALEN],
105105
* 5-11 source address
106106
* 12-13 protocol type
107107
*/
108-
memcpy(&this->tx_eth_hdr[ETH_ALEN], braddr, ETH_ALEN);
109-
memcpy(&this->tx_eth_hdr[ETH_ALEN], ethaddr, ETH_ALEN);
108+
ether_addr_copy(&this->tx_eth_hdr[ETH_ALEN], braddr);
109+
ether_addr_copy(&this->tx_eth_hdr[ETH_ALEN], ethaddr);
110110
this->tx_eth_hdr[12] = cpu_to_be16(ETH_P_802_EX1) & 0xff;
111111
this->tx_eth_hdr[13] = (cpu_to_be16(ETH_P_802_EX1) >> 8) & 0xff;
112112
pr_debug("caif ethernet TX-header dst:%pM src:%pM type:%02x%02x\n",

0 commit comments

Comments
 (0)