summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/selftest.c
diff options
context:
space:
mode:
authorEdward Cree <ecree@solarflare.com>2014-03-07 18:27:41 +0000
committerDavid S. Miller <davem@davemloft.net>2014-03-10 13:53:37 -0400
commitcd84ff4da1f46cbdc2d73366eabe9a8f818447cd (patch)
tree760779885f2e4d9b9fa319fa35e3d6209908968c /drivers/net/ethernet/sfc/selftest.c
parent19433646fec836f6804fd5409f8a89a5869d1c7d (diff)
downloadlinux-cd84ff4da1f46cbdc2d73366eabe9a8f818447cd.tar.bz2
sfc: Use ether_addr_copy and eth_broadcast_addr
Faster than memcpy/memset on some architectures. Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/selftest.c')
-rw-r--r--drivers/net/ethernet/sfc/selftest.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/sfc/selftest.c b/drivers/net/ethernet/sfc/selftest.c
index 26641817a9c7..0fc5baef45b1 100644
--- a/drivers/net/ethernet/sfc/selftest.c
+++ b/drivers/net/ethernet/sfc/selftest.c
@@ -50,7 +50,7 @@ struct efx_loopback_payload {
} __packed;
/* Loopback test source MAC address */
-static const unsigned char payload_source[ETH_ALEN] = {
+static const u8 payload_source[ETH_ALEN] __aligned(2) = {
0x00, 0x0f, 0x53, 0x1b, 0x1b, 0x1b,
};
@@ -366,8 +366,8 @@ static void efx_iterate_state(struct efx_nic *efx)
struct efx_loopback_payload *payload = &state->payload;
/* Initialise the layerII header */
- memcpy(&payload->header.h_dest, net_dev->dev_addr, ETH_ALEN);
- memcpy(&payload->header.h_source, &payload_source, ETH_ALEN);
+ ether_addr_copy((u8 *)&payload->header.h_dest, net_dev->dev_addr);
+ ether_addr_copy((u8 *)&payload->header.h_source, payload_source);
payload->header.h_proto = htons(ETH_P_IP);
/* saddr set later and used as incrementing count */