From 49670b6eae94aa2d786c694402f06f9a0c729111 Mon Sep 17 00:00:00 2001 From: Xiao Wang Date: Fri, 19 Feb 2016 19:06:58 +0800 Subject: [PATCH] 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 --- drivers/net/fm10k/base/fm10k_pf.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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; } -- 2.20.1