提交 f0cf5c98 编写于 作者: J Jacob Keller 提交者: Jeff Kirsher

fm10k: use ether_addr_copy to copy MAC address

Use the ether_addr_copy function instead of copying byte-by-byte in a
for-loop by hand.
Reported-by: NBruce Allan <bruce.w.allan@intel.com>
Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
Tested-by: NKrishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 f68766d8
...@@ -266,7 +266,6 @@ static s32 fm10k_read_mac_addr_pf(struct fm10k_hw *hw) ...@@ -266,7 +266,6 @@ static s32 fm10k_read_mac_addr_pf(struct fm10k_hw *hw)
{ {
u8 perm_addr[ETH_ALEN]; u8 perm_addr[ETH_ALEN];
u32 serial_num; u32 serial_num;
int i;
serial_num = fm10k_read_reg(hw, FM10K_SM_AREA(1)); serial_num = fm10k_read_reg(hw, FM10K_SM_AREA(1));
...@@ -288,10 +287,8 @@ static s32 fm10k_read_mac_addr_pf(struct fm10k_hw *hw) ...@@ -288,10 +287,8 @@ static s32 fm10k_read_mac_addr_pf(struct fm10k_hw *hw)
perm_addr[4] = (u8)(serial_num >> 8); perm_addr[4] = (u8)(serial_num >> 8);
perm_addr[5] = (u8)(serial_num); perm_addr[5] = (u8)(serial_num);
for (i = 0; i < ETH_ALEN; i++) { ether_addr_copy(hw->mac.perm_addr, perm_addr);
hw->mac.perm_addr[i] = perm_addr[i]; ether_addr_copy(hw->mac.addr, perm_addr);
hw->mac.addr[i] = perm_addr[i];
}
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册