igbvf: Use ETH_ALEN
authorJoe Perches <joe@perches.com>
Sun, 18 Mar 2012 17:37:58 +0000 (17:37 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 19 Mar 2012 20:53:08 +0000 (16:53 -0400)
Remove an unnecessary #define and use memcpy
instead of a loop to copy an ethernet address.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/intel/igbvf/defines.h
drivers/net/ethernet/intel/igbvf/vf.c

index 33f40d3474ae46ef5f4e932c86296a591bbb6301..3e18045d8f89f69d5e374d246f49a91320399a0c 100644 (file)
 #define E1000_ERR_MAC_INIT 5
 #define E1000_ERR_MBX      15
 
-#ifndef ETH_ADDR_LEN
-#define ETH_ADDR_LEN                 6
-#endif
-
 /* SRRCTL bit definitions */
 #define E1000_SRRCTL_BSIZEPKT_SHIFT                     10 /* Shift _right_ */
 #define E1000_SRRCTL_BSIZEHDRSIZE_MASK                  0x00000F00
index 19551977b352c1a2ceb8ed9a2864d7300cab52e1..30a6cc426037db58b214aed762f635c496ea0ca3 100644 (file)
@@ -246,7 +246,7 @@ static void e1000_update_mc_addr_list_vf(struct e1000_hw *hw,
        for (i = 0; i < cnt; i++) {
                hash_value = e1000_hash_mc_addr_vf(hw, mc_addr_list);
                hash_list[i] = hash_value & 0x0FFFF;
-               mc_addr_list += ETH_ADDR_LEN;
+               mc_addr_list += ETH_ALEN;
        }
 
        mbx->ops.write_posted(hw, msgbuf, E1000_VFMAILBOX_SIZE);
@@ -333,10 +333,7 @@ static void e1000_rar_set_vf(struct e1000_hw *hw, u8 * addr, u32 index)
  **/
 static s32 e1000_read_mac_addr_vf(struct e1000_hw *hw)
 {
-       int i;
-
-       for (i = 0; i < ETH_ADDR_LEN; i++)
-               hw->mac.addr[i] = hw->mac.perm_addr[i];
+       memcpy(hw->mac.addr, hw->mac.perm_addr, ETH_ALEN);
 
        return E1000_SUCCESS;
 }