Skip to content

Commit

Permalink
mac80211: use eth_zero_addr() to clear mac address
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Miaohe Lin authored and Johannes Berg committed Aug 3, 2020
1 parent 6628d00 commit 47d76e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/mac80211/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 47d76e3

Please sign in to comment.