Browse Source

staging: et131x: Use ether_addr_copy when copying ethernet addresses

Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Mark Einon 11 years ago
parent
commit
37dcca4364
1 changed files with 5 additions and 7 deletions
  1. 5 7
      drivers/staging/et131x/et131x.c

+ 5 - 7
drivers/staging/et131x/et131x.c

@@ -3192,15 +3192,13 @@ static void et131x_hwaddr_init(struct et131x_adapter *adapter)
 		 * working with so we need to copy the current
 		 * working with so we need to copy the current
 		 * address into the permanent address
 		 * address into the permanent address
 		 */
 		 */
-		memcpy(adapter->rom_addr,
-		       adapter->addr, ETH_ALEN);
+		ether_addr_copy(adapter->rom_addr, adapter->addr);
 	} else {
 	} else {
 		/* We do not have an override address, so set the
 		/* We do not have an override address, so set the
 		 * current address to the permanent address and add
 		 * current address to the permanent address and add
 		 * it to the device
 		 * it to the device
 		 */
 		 */
-		memcpy(adapter->addr,
-		       adapter->rom_addr, ETH_ALEN);
+		ether_addr_copy(adapter->addr, adapter->rom_addr);
 	}
 	}
 }
 }
 
 
@@ -4055,7 +4053,7 @@ static void et131x_multicast(struct net_device *netdev)
 	netdev_for_each_mc_addr(ha, netdev) {
 	netdev_for_each_mc_addr(ha, netdev) {
 		if (i == NIC_MAX_MCAST_LIST)
 		if (i == NIC_MAX_MCAST_LIST)
 			break;
 			break;
-		memcpy(adapter->multicast_list[i++], ha->addr, ETH_ALEN);
+		ether_addr_copy(adapter->multicast_list[i++], ha->addr);
 	}
 	}
 	adapter->multicast_addr_count = i;
 	adapter->multicast_addr_count = i;
 
 
@@ -4185,7 +4183,7 @@ static int et131x_change_mtu(struct net_device *netdev, int new_mtu)
 	et131x_init_send(adapter);
 	et131x_init_send(adapter);
 
 
 	et131x_hwaddr_init(adapter);
 	et131x_hwaddr_init(adapter);
-	memcpy(netdev->dev_addr, adapter->addr, ETH_ALEN);
+	ether_addr_copy(netdev->dev_addr, adapter->addr);
 
 
 	/* Init the device with the new settings */
 	/* Init the device with the new settings */
 	et131x_adapter_setup(adapter);
 	et131x_adapter_setup(adapter);
@@ -4303,7 +4301,7 @@ static int et131x_pci_setup(struct pci_dev *pdev,
 	netif_napi_add(netdev, &adapter->napi, et131x_poll, 64);
 	netif_napi_add(netdev, &adapter->napi, et131x_poll, 64);
 
 
 	/* Copy address into the net_device struct */
 	/* Copy address into the net_device struct */
-	memcpy(netdev->dev_addr, adapter->addr, ETH_ALEN);
+	ether_addr_copy(netdev->dev_addr, adapter->addr);
 
 
 	rc = -ENOMEM;
 	rc = -ENOMEM;