diff options
author | Joe Perches <joe@perches.com> | 2015-03-02 22:54:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-03 17:01:36 -0500 |
commit | 93803b3385c653bc6fd391c0de00ef811b3dadc0 (patch) | |
tree | e235b7e13f190356597758d2f498ce4e79d6d5a8 /drivers/net/wireless/mwifiex | |
parent | 519983b129477cb8e0bbea334c72ecd4486b2d21 (diff) |
wireless: Use eth_<foo>_addr instead of memset
Use the built-in function instead of memset.
Miscellanea:
Add #include <linux/etherdevice.h> where appropriate
Use ETH_ALEN instead of 6
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/init.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_event.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/wmm.c | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 41c8e25df954..7c3ca2f50186 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -1563,7 +1563,7 @@ mwifiex_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, | |||
1563 | 1563 | ||
1564 | wiphy_dbg(wiphy, "%s: mac address %pM\n", __func__, params->mac); | 1564 | wiphy_dbg(wiphy, "%s: mac address %pM\n", __func__, params->mac); |
1565 | 1565 | ||
1566 | memset(deauth_mac, 0, ETH_ALEN); | 1566 | eth_zero_addr(deauth_mac); |
1567 | 1567 | ||
1568 | spin_lock_irqsave(&priv->sta_list_spinlock, flags); | 1568 | spin_lock_irqsave(&priv->sta_list_spinlock, flags); |
1569 | sta_node = mwifiex_get_sta_entry(priv, params->mac); | 1569 | sta_node = mwifiex_get_sta_entry(priv, params->mac); |
@@ -1786,7 +1786,7 @@ mwifiex_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev, | |||
1786 | wiphy_dbg(wiphy, "info: successfully disconnected from %pM:" | 1786 | wiphy_dbg(wiphy, "info: successfully disconnected from %pM:" |
1787 | " reason code %d\n", priv->cfg_bssid, reason_code); | 1787 | " reason code %d\n", priv->cfg_bssid, reason_code); |
1788 | 1788 | ||
1789 | memset(priv->cfg_bssid, 0, ETH_ALEN); | 1789 | eth_zero_addr(priv->cfg_bssid); |
1790 | priv->hs2_enabled = false; | 1790 | priv->hs2_enabled = false; |
1791 | 1791 | ||
1792 | return 0; | 1792 | return 0; |
@@ -2046,7 +2046,7 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, | |||
2046 | dev_dbg(priv->adapter->dev, | 2046 | dev_dbg(priv->adapter->dev, |
2047 | "info: association to bssid %pM failed\n", | 2047 | "info: association to bssid %pM failed\n", |
2048 | priv->cfg_bssid); | 2048 | priv->cfg_bssid); |
2049 | memset(priv->cfg_bssid, 0, ETH_ALEN); | 2049 | eth_zero_addr(priv->cfg_bssid); |
2050 | 2050 | ||
2051 | if (ret > 0) | 2051 | if (ret > 0) |
2052 | cfg80211_connect_result(priv->netdev, priv->cfg_bssid, | 2052 | cfg80211_connect_result(priv->netdev, priv->cfg_bssid, |
@@ -2194,7 +2194,7 @@ mwifiex_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev) | |||
2194 | if (mwifiex_deauthenticate(priv, NULL)) | 2194 | if (mwifiex_deauthenticate(priv, NULL)) |
2195 | return -EFAULT; | 2195 | return -EFAULT; |
2196 | 2196 | ||
2197 | memset(priv->cfg_bssid, 0, ETH_ALEN); | 2197 | eth_zero_addr(priv->cfg_bssid); |
2198 | 2198 | ||
2199 | return 0; | 2199 | return 0; |
2200 | } | 2200 | } |
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c index b77ba743e1c4..0978b1cc58b6 100644 --- a/drivers/net/wireless/mwifiex/init.c +++ b/drivers/net/wireless/mwifiex/init.c | |||
@@ -76,7 +76,7 @@ int mwifiex_init_priv(struct mwifiex_private *priv) | |||
76 | u32 i; | 76 | u32 i; |
77 | 77 | ||
78 | priv->media_connected = false; | 78 | priv->media_connected = false; |
79 | memset(priv->curr_addr, 0xff, ETH_ALEN); | 79 | eth_broadcast_addr(priv->curr_addr); |
80 | 80 | ||
81 | priv->pkt_tx_ctrl = 0; | 81 | priv->pkt_tx_ctrl = 0; |
82 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; | 82 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; |
@@ -299,7 +299,7 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter) | |||
299 | adapter->ext_scan = false; | 299 | adapter->ext_scan = false; |
300 | adapter->key_api_major_ver = 0; | 300 | adapter->key_api_major_ver = 0; |
301 | adapter->key_api_minor_ver = 0; | 301 | adapter->key_api_minor_ver = 0; |
302 | memset(adapter->perm_addr, 0xff, ETH_ALEN); | 302 | eth_broadcast_addr(adapter->perm_addr); |
303 | adapter->iface_limit.sta_intf = MWIFIEX_MAX_STA_NUM; | 303 | adapter->iface_limit.sta_intf = MWIFIEX_MAX_STA_NUM; |
304 | adapter->iface_limit.uap_intf = MWIFIEX_MAX_UAP_NUM; | 304 | adapter->iface_limit.uap_intf = MWIFIEX_MAX_UAP_NUM; |
305 | adapter->iface_limit.p2p_intf = MWIFIEX_MAX_P2P_NUM; | 305 | adapter->iface_limit.p2p_intf = MWIFIEX_MAX_P2P_NUM; |
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c index 80ffe7412496..64c4223a1e1e 100644 --- a/drivers/net/wireless/mwifiex/sta_event.c +++ b/drivers/net/wireless/mwifiex/sta_event.c | |||
@@ -135,7 +135,7 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code) | |||
135 | cfg80211_disconnected(priv->netdev, reason_code, NULL, 0, | 135 | cfg80211_disconnected(priv->netdev, reason_code, NULL, 0, |
136 | GFP_KERNEL); | 136 | GFP_KERNEL); |
137 | } | 137 | } |
138 | memset(priv->cfg_bssid, 0, ETH_ALEN); | 138 | eth_zero_addr(priv->cfg_bssid); |
139 | 139 | ||
140 | mwifiex_stop_net_dev_queue(priv->netdev, adapter); | 140 | mwifiex_stop_net_dev_queue(priv->netdev, adapter); |
141 | if (netif_carrier_ok(priv->netdev)) | 141 | if (netif_carrier_ok(priv->netdev)) |
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c index ef717acec8b7..0cd4f6bed9fc 100644 --- a/drivers/net/wireless/mwifiex/wmm.c +++ b/drivers/net/wireless/mwifiex/wmm.c | |||
@@ -730,7 +730,7 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv, | |||
730 | } else { | 730 | } else { |
731 | memcpy(ra, skb->data, ETH_ALEN); | 731 | memcpy(ra, skb->data, ETH_ALEN); |
732 | if (ra[0] & 0x01 || mwifiex_is_skb_mgmt_frame(skb)) | 732 | if (ra[0] & 0x01 || mwifiex_is_skb_mgmt_frame(skb)) |
733 | memset(ra, 0xff, ETH_ALEN); | 733 | eth_broadcast_addr(ra); |
734 | ra_list = mwifiex_wmm_get_queue_raptr(priv, tid_down, ra); | 734 | ra_list = mwifiex_wmm_get_queue_raptr(priv, tid_down, ra); |
735 | } | 735 | } |
736 | 736 | ||