[PATCH 1/1] net/wireless/ibss.c: replace memcpy by ether_addr_copy

From: Fabian Frederick
Date: Mon May 12 2014 - 13:30:57 EST


This patch also fixes some comment checkpatch warnings

Cc: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
Cc: "John W. Linville" <linville@xxxxxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
---
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/