From: Xiao Wang Date: Fri, 19 Feb 2016 11:06:58 +0000 (+0800) Subject: fm10k/base: use memcpy for MAC address copy X-Git-Tag: spdx-start~7329 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=49670b6eae94aa2d786c694402f06f9a0c729111;p=dpdk.git fm10k/base: use memcpy for MAC address copy Use memcpy instead of copying MAC address byte-by-byte. Signed-off-by: Wang Xiao W Tested-by: Heng Ding Acked-by: Jing Chen --- diff --git a/drivers/net/fm10k/base/fm10k_pf.c b/drivers/net/fm10k/base/fm10k_pf.c index 7d48210d46..a1469aaf26 100644 --- a/drivers/net/fm10k/base/fm10k_pf.c +++ b/drivers/net/fm10k/base/fm10k_pf.c @@ -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; }