lkml.org 
[lkml]   [2014]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 1/1] net/wireless/ibss.c: replace memcpy by ether_addr_copy
This patch also fixes some comment checkpatch warnings

Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
net/wireless/ibss.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c
index a6b5bda..a0a1381 100644
--- a/net/wireless/ibss.c
+++ b/net/wireless/ibss.c
@@ -49,7 +49,7 @@ void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid,
GFP_KERNEL);
#ifdef CONFIG_CFG80211_WEXT
memset(&wrqu, 0, sizeof(wrqu));
- memcpy(wrqu.ap_addr.sa_data, bssid, ETH_ALEN);
+ ether_addr_copy(wrqu.ap_addr.sa_data, bssid);
wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
#endif
}
@@ -72,7 +72,7 @@ void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid,
return;

ev->type = EVENT_IBSS_JOINED;
- memcpy(ev->ij.bssid, bssid, ETH_ALEN);
+ ether_addr_copy(ev->ij.bssid, bssid);
ev->ij.channel = channel;

spin_lock_irqsave(&wdev->event_lock, flags);
@@ -98,11 +98,10 @@ static int __cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
return -EALREADY;

if (!params->basic_rates) {
- /*
- * If no rates were explicitly configured,
- * use the mandatory rate set for 11b or
- * 11a for maximum compatibility.
- */
+ /* If no rates were explicitly configured,
+ * use the mandatory rate set for 11b or
+ * 11a for maximum compatibility.
+ */
struct ieee80211_supported_band *sband =
rdev->wiphy.bands[params->chandef.chan->band];
int j;
@@ -190,8 +189,7 @@ static void __cfg80211_clear_ibss(struct net_device *dev, bool nowext)

rdev_set_qos_map(rdev, dev, NULL);

- /*
- * Delete all the keys ... pairwise keys can't really
+ /* Delete all the keys ... pairwise keys can't really
* exist any more anyway, but default keys might.
*/
if (rdev->ops->del_key)
@@ -524,7 +522,7 @@ int cfg80211_ibss_wext_siwap(struct net_device *dev,
return err;

if (bssid) {
- memcpy(wdev->wext.bssid, bssid, ETH_ALEN);
+ ether_addr_copy(wdev->wext.bssid, bssid);
wdev->wext.ibss.bssid = wdev->wext.bssid;
} else
wdev->wext.ibss.bssid = NULL;
@@ -550,9 +548,9 @@ int cfg80211_ibss_wext_giwap(struct net_device *dev,

wdev_lock(wdev);
if (wdev->current_bss)
- memcpy(ap_addr->sa_data, wdev->current_bss->pub.bssid, ETH_ALEN);
+ ether_addr_copy(ap_addr->sa_data, wdev->current_bss->pub.bssid);
else if (wdev->wext.ibss.bssid)
- memcpy(ap_addr->sa_data, wdev->wext.ibss.bssid, ETH_ALEN);
+ ether_addr_copy(ap_addr->sa_data, wdev->wext.ibss.bssid);
else
memset(ap_addr->sa_data, 0, ETH_ALEN);

--
1.9.1

\
 
 \ /
  Last update: 2014-05-12 20:21    [W:0.066 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site