From: Joe Perches <joe@perches.com>
To: David Miller <davem@davemloft.net>
Cc: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/7] caif_usb: Use ether_addr_copy
Date: Mon, 20 Jan 2014 09:52:17 -0800 [thread overview]
Message-ID: <73ad3aea35df9926aa882b2b863d54c2c01e401d.1390239869.git.joe@perches.com> (raw)
In-Reply-To: <cover.1390239869.git.joe@perches.com>
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>
---
net/caif/caif_usb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/caif/caif_usb.c b/net/caif/caif_usb.c
index 75ed04b..dda589c 100644
--- a/net/caif/caif_usb.c
+++ b/net/caif/caif_usb.c
@@ -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",
--
1.8.1.2.459.gbcd45b4.dirty
next prev parent reply other threads:[~2014-01-20 17:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20140115.164540.450877805879786067.davem@davemloft.net>
2014-01-20 17:52 ` [PATCH 0/7] net: Convert aligned memcpy to ether_addr_copy Joe Perches
2014-01-20 17:52 ` [PATCH 1/7] 8021q: Use ether_addr_copy Joe Perches
2014-01-22 2:13 ` David Miller
2014-01-20 17:52 ` [PATCH 2/7] appletalk: " Joe Perches
2014-01-20 17:52 ` [PATCH 3/7] atm: " Joe Perches
2014-01-20 17:52 ` Joe Perches [this message]
2014-01-20 17:52 ` [PATCH 5/7] netpoll: " Joe Perches
2014-01-20 17:52 ` [PATCH 6/7] pktgen: " Joe Perches
2014-01-20 17:52 ` [PATCH 7/7] dsa: " Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=73ad3aea35df9926aa882b2b863d54c2c01e401d.1390239869.git.joe@perches.com \
--to=joe@perches.com \
--cc=davem@davemloft.net \
--cc=dmitry.tarnyagin@lockless.no \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®