fm10k/base: use memcpy for MAC address copy
authorXiao Wang <xiao.w.wang@intel.com>
Fri, 19 Feb 2016 11:06:58 +0000 (19:06 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 16 Mar 2016 17:51:44 +0000 (18:51 +0100)
Use memcpy instead of copying MAC address byte-by-byte.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
drivers/net/fm10k/base/fm10k_pf.c

index 7d48210..a1469aa 100644 (file)
@@ -300,7 +300,6 @@ STATIC s32 fm10k_read_mac_addr_pf(struct fm10k_hw *hw)
 {
        u8 perm_addr[ETH_ALEN];
        u32 serial_num;
-       int i;
 
        DEBUGFUNC("fm10k_read_mac_addr_pf");
 
@@ -324,10 +323,8 @@ STATIC s32 fm10k_read_mac_addr_pf(struct fm10k_hw *hw)
        perm_addr[4] = (u8)(serial_num >> 8);
        perm_addr[5] = (u8)(serial_num);
 
-       for (i = 0; i < ETH_ALEN; i++) {
-               hw->mac.perm_addr[i] = perm_addr[i];
-               hw->mac.addr[i] = perm_addr[i];
-       }
+       memcpy(hw->mac.perm_addr, perm_addr, ETH_ALEN);
+       memcpy(hw->mac.addr, perm_addr, ETH_ALEN);
 
        return FM10K_SUCCESS;
 }