mac80211: use eth_zero_addr() to clear mac address
authorMiaohe Lin <linmiaohe@huawei.com>
Sat, 1 Aug 2020 09:12:38 +0000 (17:12 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 3 Aug 2020 08:56:04 +0000 (10:56 +0200)
Use eth_zero_addr() to clear mac address instead of memset().

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Link: https://lore.kernel.org/r/1596273158-24183-1-git-send-email-linmiaohe@huawei.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/trace.h

index 1b4709694d2a89213a774284a5927c982c6b22f6..50ab5b9d8eab9f32168fd56f9218fea8bb00852f 100644 (file)
@@ -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