Commit d2beae10 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

wireless: Use eth_<foo>_addr instead of memset

Use the built-in function instead of memset.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c84a67a2
...@@ -533,7 +533,7 @@ int cfg80211_ibss_wext_giwap(struct net_device *dev, ...@@ -533,7 +533,7 @@ int cfg80211_ibss_wext_giwap(struct net_device *dev,
else if (wdev->wext.ibss.bssid) else if (wdev->wext.ibss.bssid)
memcpy(ap_addr->sa_data, wdev->wext.ibss.bssid, ETH_ALEN); memcpy(ap_addr->sa_data, wdev->wext.ibss.bssid, ETH_ALEN);
else else
memset(ap_addr->sa_data, 0, ETH_ALEN); eth_zero_addr(ap_addr->sa_data);
wdev_unlock(wdev); wdev_unlock(wdev);
......
...@@ -5683,8 +5683,8 @@ static int nl80211_parse_random_mac(struct nlattr **attrs, ...@@ -5683,8 +5683,8 @@ static int nl80211_parse_random_mac(struct nlattr **attrs,
int i; int i;
if (!attrs[NL80211_ATTR_MAC] && !attrs[NL80211_ATTR_MAC_MASK]) { if (!attrs[NL80211_ATTR_MAC] && !attrs[NL80211_ATTR_MAC_MASK]) {
memset(mac_addr, 0, ETH_ALEN); eth_zero_addr(mac_addr);
memset(mac_addr_mask, 0, ETH_ALEN); eth_zero_addr(mac_addr_mask);
mac_addr[0] = 0x2; mac_addr[0] = 0x2;
mac_addr_mask[0] = 0x3; mac_addr_mask[0] = 0x3;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <linux/tracepoint.h> #include <linux/tracepoint.h>
#include <linux/rtnetlink.h> #include <linux/rtnetlink.h>
#include <linux/etherdevice.h>
#include <net/cfg80211.h> #include <net/cfg80211.h>
#include "core.h" #include "core.h"
...@@ -15,7 +16,7 @@ ...@@ -15,7 +16,7 @@
if (given_mac) \ if (given_mac) \
memcpy(__entry->entry_mac, given_mac, ETH_ALEN); \ memcpy(__entry->entry_mac, given_mac, ETH_ALEN); \
else \ else \
memset(__entry->entry_mac, 0, ETH_ALEN); \ eth_zero_addr(__entry->entry_mac); \
} while (0) } while (0)
#define MAC_PR_FMT "%pM" #define MAC_PR_FMT "%pM"
#define MAC_PR_ARG(entry_mac) (__entry->entry_mac) #define MAC_PR_ARG(entry_mac) (__entry->entry_mac)
...@@ -1077,7 +1078,7 @@ TRACE_EVENT(rdev_auth, ...@@ -1077,7 +1078,7 @@ TRACE_EVENT(rdev_auth,
if (req->bss) if (req->bss)
MAC_ASSIGN(bssid, req->bss->bssid); MAC_ASSIGN(bssid, req->bss->bssid);
else else
memset(__entry->bssid, 0, ETH_ALEN); eth_zero_addr(__entry->bssid);
__entry->auth_type = req->auth_type; __entry->auth_type = req->auth_type;
), ),
TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", auth type: %d, bssid: " MAC_PR_FMT, TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", auth type: %d, bssid: " MAC_PR_FMT,
...@@ -1103,7 +1104,7 @@ TRACE_EVENT(rdev_assoc, ...@@ -1103,7 +1104,7 @@ TRACE_EVENT(rdev_assoc,
if (req->bss) if (req->bss)
MAC_ASSIGN(bssid, req->bss->bssid); MAC_ASSIGN(bssid, req->bss->bssid);
else else
memset(__entry->bssid, 0, ETH_ALEN); eth_zero_addr(__entry->bssid);
MAC_ASSIGN(prev_bssid, req->prev_bssid); MAC_ASSIGN(prev_bssid, req->prev_bssid);
__entry->use_mfp = req->use_mfp; __entry->use_mfp = req->use_mfp;
__entry->flags = req->flags; __entry->flags = req->flags;
...@@ -1153,7 +1154,7 @@ TRACE_EVENT(rdev_disassoc, ...@@ -1153,7 +1154,7 @@ TRACE_EVENT(rdev_disassoc,
if (req->bss) if (req->bss)
MAC_ASSIGN(bssid, req->bss->bssid); MAC_ASSIGN(bssid, req->bss->bssid);
else else
memset(__entry->bssid, 0, ETH_ALEN); eth_zero_addr(__entry->bssid);
__entry->reason_code = req->reason_code; __entry->reason_code = req->reason_code;
__entry->local_state_change = req->local_state_change; __entry->local_state_change = req->local_state_change;
), ),
......
...@@ -322,7 +322,7 @@ int cfg80211_mgd_wext_giwap(struct net_device *dev, ...@@ -322,7 +322,7 @@ int cfg80211_mgd_wext_giwap(struct net_device *dev,
if (wdev->current_bss) if (wdev->current_bss)
memcpy(ap_addr->sa_data, wdev->current_bss->pub.bssid, ETH_ALEN); memcpy(ap_addr->sa_data, wdev->current_bss->pub.bssid, ETH_ALEN);
else else
memset(ap_addr->sa_data, 0, ETH_ALEN); eth_zero_addr(ap_addr->sa_data);
wdev_unlock(wdev); wdev_unlock(wdev);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment