netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: David Miller <davem@davemloft.net>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 7/7] dsa: Use ether_addr_copy
Date: Mon, 20 Jan 2014 09:52:20 -0800	[thread overview]
Message-ID: <3c33df937d3cf83447bad0d6d219bdf66b629735.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/dsa/slave.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 29d684e..02c0e17 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -156,7 +156,7 @@ static int dsa_slave_set_mac_address(struct net_device *dev, void *a)
 		dev_uc_del(master, dev->dev_addr);
 
 out:
-	memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
+	ether_addr_copy(dev->dev_addr, addr->sa_data);
 
 	return 0;
 }
-- 
1.8.1.2.459.gbcd45b4.dirty

      parent reply	other threads:[~2014-01-20 17:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-14 23:18 [RFC PATCH net-next] etherdevice: Use ether_addr_copy to copy an Ethernet address Joe Perches
2014-01-15 23:39 ` David Miller
2014-01-16  0:07   ` Joe Perches
2014-01-16  0:45     ` David Miller
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         ` [PATCH 4/7] caif_usb: " Joe Perches
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         ` Joe Perches [this message]

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=3c33df937d3cf83447bad0d6d219bdf66b629735.1390239869.git.joe@perches.com \
    --to=joe@perches.com \
    --cc=davem@davemloft.net \
    --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;
as well as URLs for NNTP newsgroup(s).