diff options
author | Joe Perches <joe@perches.com> | 2015-03-02 22:54:58 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-03 17:01:38 -0500 |
commit | d2beae1078a236d503b6e010fc4d65bb2e14dbdc (patch) | |
tree | 659bf9e8f4319f1c626fee9bb07f6ea366e42ff0 /net | |
parent | c84a67a2fc70841e642fe2f0429abb1d9b4d2167 (diff) |
wireless: Use eth_<foo>_addr instead of memset
Use the built-in function instead of memset.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/wireless/ibss.c | 2 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 4 | ||||
-rw-r--r-- | net/wireless/trace.h | 9 | ||||
-rw-r--r-- | net/wireless/wext-sme.c | 2 |
4 files changed, 9 insertions, 8 deletions
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c index e24fc585c883..6309b9c0bcd5 100644 --- a/net/wireless/ibss.c +++ b/net/wireless/ibss.c | |||
@@ -533,7 +533,7 @@ int cfg80211_ibss_wext_giwap(struct net_device *dev, | |||
533 | else if (wdev->wext.ibss.bssid) | 533 | else if (wdev->wext.ibss.bssid) |
534 | memcpy(ap_addr->sa_data, wdev->wext.ibss.bssid, ETH_ALEN); | 534 | memcpy(ap_addr->sa_data, wdev->wext.ibss.bssid, ETH_ALEN); |
535 | else | 535 | else |
536 | memset(ap_addr->sa_data, 0, ETH_ALEN); | 536 | eth_zero_addr(ap_addr->sa_data); |
537 | 537 | ||
538 | wdev_unlock(wdev); | 538 | wdev_unlock(wdev); |
539 | 539 | ||
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index d78fd8b54515..96fe32889f5e 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -5683,8 +5683,8 @@ static int nl80211_parse_random_mac(struct nlattr **attrs, | |||
5683 | int i; | 5683 | int i; |
5684 | 5684 | ||
5685 | if (!attrs[NL80211_ATTR_MAC] && !attrs[NL80211_ATTR_MAC_MASK]) { | 5685 | if (!attrs[NL80211_ATTR_MAC] && !attrs[NL80211_ATTR_MAC_MASK]) { |
5686 | memset(mac_addr, 0, ETH_ALEN); | 5686 | eth_zero_addr(mac_addr); |
5687 | memset(mac_addr_mask, 0, ETH_ALEN); | 5687 | eth_zero_addr(mac_addr_mask); |
5688 | mac_addr[0] = 0x2; | 5688 | mac_addr[0] = 0x2; |
5689 | mac_addr_mask[0] = 0x3; | 5689 | mac_addr_mask[0] = 0x3; |
5690 | 5690 | ||
diff --git a/net/wireless/trace.h b/net/wireless/trace.h index b17b3692f8c2..a00ee8897dc6 100644 --- a/net/wireless/trace.h +++ b/net/wireless/trace.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/tracepoint.h> | 7 | #include <linux/tracepoint.h> |
8 | 8 | ||
9 | #include <linux/rtnetlink.h> | 9 | #include <linux/rtnetlink.h> |
10 | #include <linux/etherdevice.h> | ||
10 | #include <net/cfg80211.h> | 11 | #include <net/cfg80211.h> |
11 | #include "core.h" | 12 | #include "core.h" |
12 | 13 | ||
@@ -15,7 +16,7 @@ | |||
15 | if (given_mac) \ | 16 | if (given_mac) \ |
16 | memcpy(__entry->entry_mac, given_mac, ETH_ALEN); \ | 17 | memcpy(__entry->entry_mac, given_mac, ETH_ALEN); \ |
17 | else \ | 18 | else \ |
18 | memset(__entry->entry_mac, 0, ETH_ALEN); \ | 19 | eth_zero_addr(__entry->entry_mac); \ |
19 | } while (0) | 20 | } while (0) |
20 | #define MAC_PR_FMT "%pM" | 21 | #define MAC_PR_FMT "%pM" |
21 | #define MAC_PR_ARG(entry_mac) (__entry->entry_mac) | 22 | #define MAC_PR_ARG(entry_mac) (__entry->entry_mac) |
@@ -1077,7 +1078,7 @@ TRACE_EVENT(rdev_auth, | |||
1077 | if (req->bss) | 1078 | if (req->bss) |
1078 | MAC_ASSIGN(bssid, req->bss->bssid); | 1079 | MAC_ASSIGN(bssid, req->bss->bssid); |
1079 | else | 1080 | else |
1080 | memset(__entry->bssid, 0, ETH_ALEN); | 1081 | eth_zero_addr(__entry->bssid); |
1081 | __entry->auth_type = req->auth_type; | 1082 | __entry->auth_type = req->auth_type; |
1082 | ), | 1083 | ), |
1083 | TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", auth type: %d, bssid: " MAC_PR_FMT, | 1084 | TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", auth type: %d, bssid: " MAC_PR_FMT, |
@@ -1103,7 +1104,7 @@ TRACE_EVENT(rdev_assoc, | |||
1103 | if (req->bss) | 1104 | if (req->bss) |
1104 | MAC_ASSIGN(bssid, req->bss->bssid); | 1105 | MAC_ASSIGN(bssid, req->bss->bssid); |
1105 | else | 1106 | else |
1106 | memset(__entry->bssid, 0, ETH_ALEN); | 1107 | eth_zero_addr(__entry->bssid); |
1107 | MAC_ASSIGN(prev_bssid, req->prev_bssid); | 1108 | MAC_ASSIGN(prev_bssid, req->prev_bssid); |
1108 | __entry->use_mfp = req->use_mfp; | 1109 | __entry->use_mfp = req->use_mfp; |
1109 | __entry->flags = req->flags; | 1110 | __entry->flags = req->flags; |
@@ -1153,7 +1154,7 @@ TRACE_EVENT(rdev_disassoc, | |||
1153 | if (req->bss) | 1154 | if (req->bss) |
1154 | MAC_ASSIGN(bssid, req->bss->bssid); | 1155 | MAC_ASSIGN(bssid, req->bss->bssid); |
1155 | else | 1156 | else |
1156 | memset(__entry->bssid, 0, ETH_ALEN); | 1157 | eth_zero_addr(__entry->bssid); |
1157 | __entry->reason_code = req->reason_code; | 1158 | __entry->reason_code = req->reason_code; |
1158 | __entry->local_state_change = req->local_state_change; | 1159 | __entry->local_state_change = req->local_state_change; |
1159 | ), | 1160 | ), |
diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c index 368611c05739..a4e8af3321d2 100644 --- a/net/wireless/wext-sme.c +++ b/net/wireless/wext-sme.c | |||
@@ -322,7 +322,7 @@ int cfg80211_mgd_wext_giwap(struct net_device *dev, | |||
322 | if (wdev->current_bss) | 322 | if (wdev->current_bss) |
323 | memcpy(ap_addr->sa_data, wdev->current_bss->pub.bssid, ETH_ALEN); | 323 | memcpy(ap_addr->sa_data, wdev->current_bss->pub.bssid, ETH_ALEN); |
324 | else | 324 | else |
325 | memset(ap_addr->sa_data, 0, ETH_ALEN); | 325 | eth_zero_addr(ap_addr->sa_data); |
326 | wdev_unlock(wdev); | 326 | wdev_unlock(wdev); |
327 | 327 | ||
328 | return 0; | 328 | return 0; |