Commit 07fc67be authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

8021q: 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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 70fccb7e
...@@ -301,7 +301,7 @@ static void vlan_sync_address(struct net_device *dev, ...@@ -301,7 +301,7 @@ static void vlan_sync_address(struct net_device *dev,
!ether_addr_equal(vlandev->dev_addr, dev->dev_addr)) !ether_addr_equal(vlandev->dev_addr, dev->dev_addr))
dev_uc_add(dev, vlandev->dev_addr); dev_uc_add(dev, vlandev->dev_addr);
memcpy(vlan->real_dev_addr, dev->dev_addr, ETH_ALEN); ether_addr_copy(vlan->real_dev_addr, dev->dev_addr);
} }
static void vlan_transfer_features(struct net_device *dev, static void vlan_transfer_features(struct net_device *dev,
......
...@@ -61,7 +61,7 @@ static int vlan_dev_rebuild_header(struct sk_buff *skb) ...@@ -61,7 +61,7 @@ static int vlan_dev_rebuild_header(struct sk_buff *skb)
pr_debug("%s: unable to resolve type %X addresses\n", pr_debug("%s: unable to resolve type %X addresses\n",
dev->name, ntohs(veth->h_vlan_encapsulated_proto)); dev->name, ntohs(veth->h_vlan_encapsulated_proto));
memcpy(veth->h_source, dev->dev_addr, ETH_ALEN); ether_addr_copy(veth->h_source, dev->dev_addr);
break; break;
} }
...@@ -303,7 +303,7 @@ static int vlan_dev_open(struct net_device *dev) ...@@ -303,7 +303,7 @@ static int vlan_dev_open(struct net_device *dev)
goto clear_allmulti; goto clear_allmulti;
} }
memcpy(vlan->real_dev_addr, real_dev->dev_addr, ETH_ALEN); ether_addr_copy(vlan->real_dev_addr, real_dev->dev_addr);
if (vlan->flags & VLAN_FLAG_GVRP) if (vlan->flags & VLAN_FLAG_GVRP)
vlan_gvrp_request_join(dev); vlan_gvrp_request_join(dev);
...@@ -367,7 +367,7 @@ static int vlan_dev_set_mac_address(struct net_device *dev, void *p) ...@@ -367,7 +367,7 @@ static int vlan_dev_set_mac_address(struct net_device *dev, void *p)
dev_uc_del(real_dev, dev->dev_addr); dev_uc_del(real_dev, dev->dev_addr);
out: out:
memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); ether_addr_copy(dev->dev_addr, addr->sa_data);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment