diff mbox series

mac80211: use eth_zero_addr() to clear mac address

Message ID 1596273158-24183-1-git-send-email-linmiaohe@huawei.com
State Changes Requested
Delegated to: David Miller
Headers show
Series mac80211: use eth_zero_addr() to clear mac address | expand

Commit Message

Miaohe Lin Aug. 1, 2020, 9:12 a.m. UTC
From: Miaohe Lin <linmiaohe@huawei.com>

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

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 net/mac80211/trace.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

David Miller Aug. 3, 2020, 10:37 p.m. UTC | #1
From: linmiaohe <linmiaohe@huawei.com>
Date: Sat, 1 Aug 2020 17:12:38 +0800

> From: Miaohe Lin <linmiaohe@huawei.com>
> 
> Use eth_zero_addr() to clear mac address instead of memset().
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

If you're going to make this change, you should probably convert this macro
to use eth_addr_copy() at the same time.
diff mbox series

Patch

diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 1b4709694d2a..50ab5b9d8eab 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -22,7 +22,8 @@ 
 #define LOCAL_PR_ARG	__entry->wiphy_name
 
 #define STA_ENTRY	__array(char, sta_addr, ETH_ALEN)
-#define STA_ASSIGN	(sta ? memcpy(__entry->sta_addr, sta->addr, ETH_ALEN) : memset(__entry->sta_addr, 0, ETH_ALEN))
+#define STA_ASSIGN	(sta ? memcpy(__entry->sta_addr, sta->addr, ETH_ALEN) : \
+				eth_zero_addr(__entry->sta_addr))
 #define STA_NAMED_ASSIGN(s)	memcpy(__entry->sta_addr, (s)->addr, ETH_ALEN)
 #define STA_PR_FMT	" sta:%pM"
 #define STA_PR_ARG	__entry->sta_addr