2020-07-20 08:29:18

by Miaohe Lin

[permalink] [raw]
Subject: [PATCH] igb: use eth_zero_addr() to clear mac address

From: Miaohe Lin <[email protected]>

Use eth_zero_addr() to clear mac address insetad of memset().

Signed-off-by: Miaohe Lin <[email protected]>
---
drivers/net/ethernet/intel/igb/igb_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 8bb3db2cbd41..adedd98f1e3e 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -7168,7 +7168,7 @@ static void igb_flush_mac_table(struct igb_adapter *adapter)

for (i = 0; i < hw->mac.rar_entry_count; i++) {
adapter->mac_table[i].state &= ~IGB_MAC_STATE_IN_USE;
- memset(adapter->mac_table[i].addr, 0, ETH_ALEN);
+ eth_zero_addr(adapter->mac_table[i].addr);
adapter->mac_table[i].queue = 0;
igb_rar_set_index(adapter, i);
}
@@ -7317,7 +7317,7 @@ static int igb_del_mac_filter_flags(struct igb_adapter *adapter,
} else {
adapter->mac_table[i].state = 0;
adapter->mac_table[i].queue = 0;
- memset(adapter->mac_table[i].addr, 0, ETH_ALEN);
+ eth_zero_addr(adapter->mac_table[i].addr);
}

igb_rar_set_index(adapter, i);
--
2.19.1


2020-07-30 18:14:36

by Brown, Aaron F

[permalink] [raw]
Subject: RE: [PATCH] igb: use eth_zero_addr() to clear mac address

> From: linmiaohe <[email protected]>
> Sent: Monday, July 20, 2020 1:29 AM
> To: Kirsher, Jeffrey T <[email protected]>; [email protected];
> [email protected]
> Cc: [email protected]; [email protected]; linux-
> [email protected]; [email protected]
> Subject: [PATCH] igb: use eth_zero_addr() to clear mac address
>
> From: Miaohe Lin <[email protected]>
>
> Use eth_zero_addr() to clear mac address insetad of memset().
>
> Signed-off-by: Miaohe Lin <[email protected]>
> ---
> drivers/net/ethernet/intel/igb/igb_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Tested-by: Aaron Brown <[email protected]>