aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/send.c
diff options
context:
space:
mode:
authorAntonio Quartulli <antonio@meshcoding.com>2014-01-21 18:42:11 -0500
committerAntonio Quartulli <antonio@meshcoding.com>2014-03-22 03:50:26 -0400
commit8fdd01530cda849ba531e7e9d8674fbc81ab5782 (patch)
treed2a19df1128530d694d7dce1c04d6f24515beb26 /net/batman-adv/send.c
parente88b617d84b53170f0781cc0756019c5b1855890 (diff)
batman-adv: prefer ether_addr_copy to memcpy
On some architectures ether_addr_copy() is slightly faster than memcpy() therefore use the former when possible. Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Diffstat (limited to 'net/batman-adv/send.c')
-rw-r--r--net/batman-adv/send.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
index 1703a2ef72a9..0e4831f624fb 100644
--- a/net/batman-adv/send.c
+++ b/net/batman-adv/send.c
@@ -59,8 +59,8 @@ int batadv_send_skb_packet(struct sk_buff *skb,
59 skb_reset_mac_header(skb); 59 skb_reset_mac_header(skb);
60 60
61 ethhdr = eth_hdr(skb); 61 ethhdr = eth_hdr(skb);
62 memcpy(ethhdr->h_source, hard_iface->net_dev->dev_addr, ETH_ALEN); 62 ether_addr_copy(ethhdr->h_source, hard_iface->net_dev->dev_addr);
63 memcpy(ethhdr->h_dest, dst_addr, ETH_ALEN); 63 ether_addr_copy(ethhdr->h_dest, dst_addr);
64 ethhdr->h_proto = htons(ETH_P_BATMAN); 64 ethhdr->h_proto = htons(ETH_P_BATMAN);
65 65
66 skb_set_network_header(skb, ETH_HLEN); 66 skb_set_network_header(skb, ETH_HLEN);
@@ -165,7 +165,7 @@ batadv_send_skb_push_fill_unicast(struct sk_buff *skb, int hdr_size,
165 /* set unicast ttl */ 165 /* set unicast ttl */
166 unicast_packet->ttl = BATADV_TTL; 166 unicast_packet->ttl = BATADV_TTL;
167 /* copy the destination for faster routing */ 167 /* copy the destination for faster routing */
168 memcpy(unicast_packet->dest, orig_node->orig, ETH_ALEN); 168 ether_addr_copy(unicast_packet->dest, orig_node->orig);
169 /* set the destination tt version number */ 169 /* set the destination tt version number */
170 unicast_packet->ttvn = ttvn; 170 unicast_packet->ttvn = ttvn;
171 171
@@ -220,7 +220,7 @@ bool batadv_send_skb_prepare_unicast_4addr(struct batadv_priv *bat_priv,
220 220
221 uc_4addr_packet = (struct batadv_unicast_4addr_packet *)skb->data; 221 uc_4addr_packet = (struct batadv_unicast_4addr_packet *)skb->data;
222 uc_4addr_packet->u.packet_type = BATADV_UNICAST_4ADDR; 222 uc_4addr_packet->u.packet_type = BATADV_UNICAST_4ADDR;
223 memcpy(uc_4addr_packet->src, primary_if->net_dev->dev_addr, ETH_ALEN); 223 ether_addr_copy(uc_4addr_packet->src, primary_if->net_dev->dev_addr);
224 uc_4addr_packet->subtype = packet_subtype; 224 uc_4addr_packet->subtype = packet_subtype;
225 uc_4addr_packet->reserved = 0; 225 uc_4addr_packet->reserved = 0;
226 226