From patchwork Tue Sep 22 14:24:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 7239441 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 01E3E9F443 for ; Tue, 22 Sep 2015 14:24:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 047DB207CC for ; Tue, 22 Sep 2015 14:24:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9A18C207E8 for ; Tue, 22 Sep 2015 14:24:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757909AbbIVOYm (ORCPT ); Tue, 22 Sep 2015 10:24:42 -0400 Received: from mout.gmx.net ([212.227.17.20]:57055 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757877AbbIVOYi (ORCPT ); Tue, 22 Sep 2015 10:24:38 -0400 Received: from localhost.localdomain ([80.187.99.86]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0Lj61K-1aHaKi3rzC-00dC15; Tue, 22 Sep 2015 16:24:35 +0200 From: Oleksij Rempel To: kvalo@codeaurora.org, ath9k-devel@qca.qualcomm.com, linux-wireless@vger.kernel.org Cc: Oleksij Rempel Subject: [PATCH] ath9k_htc: use ether_addr_copy() instead of memcpy() Date: Tue, 22 Sep 2015 16:24:26 +0200 Message-Id: <1442931866-17115-1-git-send-email-linux@rempel-privat.de> X-Mailer: git-send-email 2.5.0 In-Reply-To: <87lhbylifx.fsf@kamboji.qca.qualcomm.com> References: <87lhbylifx.fsf@kamboji.qca.qualcomm.com> X-Provags-ID: V03:K0:03pZf8cx8rebaGfbz7T8rEtPs0VlIkLRODO9RxEtsF/GMaLOzwm gNdpKwoV2PwZnTOLyaqUH0uu6hyqjkdnzcMzCPkN/MRLtrOqXkpkWkLO52/4ovR5BuQbwYt OEJep57Rq6fFZ473NWZPpFo48Br1W+2i4Hov8244pZbQrdtWlOXhZvkx9sRtmGorJf1YLuP ZHeSq890hKLQCWWov8r+Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:YdUOZcTcuEI=:tGE2eUlxwpWRiblaMAM3yz ndnGoRK5I+Vxg29si5M/N56e/u+W/7YBsqGuQ23Kg6rsR1IHdFHkARYoAZnUlTwV6y6zKo10p C/9oGCCTspMypgO+QGBuzJt9d9iR8GYxO4CeGzBDDqbeErjKmDG9ycHaJecnPtdzsXxAv4YrX uOTgAPQGm03e2U8KFTQ1x7na8U+pELF69ZmHSxomw7rYwre36RPhKhOtypXrsJ3X8fKhUaYkc pwI4IEYCp6nN5ln+dP658hp9Eybj6N6rMBI+h2GtI6DQv/C9dLI1hRdRH2dW12UEl5JjeNuN4 bf9ETws3vbICqLCbpH1H+4Isffs49LQdFmh9KGG23u3BGIBfLCGzAol9/joCWSGNPmnzzk4Ws xOVOnAmBcBsWAayX1aK52NECqX5JaF2tC9NgGtYTXZ5O8Ebj7WXYpgQGvKINd3ZyYXuo0+HEx S4SPZD12jgGLuVYuOX1h49FYos/SxKbhDC4rkbWWbenjv/qGjy8GVfi+SrhWxXqQtEP2Bn7pR hWyXejwuRl5TRASrqoitV9QTM7RvquzRhXQU0dFtNAKOFmYjcFynJyNaGIek2YL9M+BlwyUgf BJLtdufY5VrTOq1xzhY7xbboEJFfaIHTdKvIvNOV8EjXMGCGdbULfFwttb+NZaHj4C3NncC5p 55/zKOtmF2NXmcjmqov3UtMyxalx9RX3NzihKD61VVEJMZ+jJ+eJyOQzRteOSJUAuf0wJlEkZ /vyjFUhR456AYEb1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Oleksij Rempel --- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 2 +- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index 1e84882..254a1e4 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c @@ -587,7 +587,7 @@ static void ath9k_init_misc(struct ath9k_htc_priv *priv) { struct ath_common *common = ath9k_hw_common(priv->ah); - memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN); + ether_addr_copy(common->bssidmask, ath_bcast_mac); common->last_rssi = ATH_RSSI_DUMMY_MARKER; priv->ah->opmode = NL80211_IFTYPE_STATION; diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index 172a9ff..e6b13ed 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c @@ -159,10 +159,10 @@ static void ath9k_htc_set_mac_bssid_mask(struct ath9k_htc_priv *priv, priv->hw, IEEE80211_IFACE_ITER_RESUME_ALL, ath9k_htc_bssid_iter, &iter_data); - memcpy(common->bssidmask, iter_data.mask, ETH_ALEN); + ether_addr_copy(common->bssidmask, iter_data.mask); if (iter_data.hw_macaddr) - memcpy(common->macaddr, iter_data.hw_macaddr, ETH_ALEN); + ether_addr_copy(common->macaddr, iter_data.hw_macaddr); ath_hw_setbssidmask(common); } @@ -338,7 +338,7 @@ static void __ath9k_htc_remove_monitor_interface(struct ath9k_htc_priv *priv) u8 cmd_rsp; memset(&hvif, 0, sizeof(struct ath9k_htc_target_vif)); - memcpy(&hvif.myaddr, common->macaddr, ETH_ALEN); + ether_addr_copy(hvif.myaddr, common->macaddr); hvif.index = priv->mon_vif_idx; WMI_CMD_BUF(WMI_VAP_REMOVE_CMDID, &hvif); if (ret) { @@ -374,7 +374,7 @@ static int ath9k_htc_add_monitor_interface(struct ath9k_htc_priv *priv) * Add an interface. */ memset(&hvif, 0, sizeof(struct ath9k_htc_target_vif)); - memcpy(&hvif.myaddr, common->macaddr, ETH_ALEN); + ether_addr_copy(hvif.myaddr, common->macaddr); hvif.opmode = HTC_M_MONITOR; hvif.index = ffz(priv->vif_slot); @@ -404,7 +404,7 @@ static int ath9k_htc_add_monitor_interface(struct ath9k_htc_priv *priv) */ memset(&tsta, 0, sizeof(struct ath9k_htc_target_sta)); - memcpy(&tsta.macaddr, common->macaddr, ETH_ALEN); + ether_addr_copy(tsta.macaddr, common->macaddr); tsta.is_vif_sta = 1; tsta.sta_index = sta_idx; @@ -489,15 +489,15 @@ static int ath9k_htc_add_station(struct ath9k_htc_priv *priv, if (sta) { ista = (struct ath9k_htc_sta *) sta->drv_priv; - memcpy(&tsta.macaddr, sta->addr, ETH_ALEN); - memcpy(&tsta.bssid, common->curbssid, ETH_ALEN); + ether_addr_copy(tsta.macaddr, sta->addr); + ether_addr_copy(tsta.bssid, common->curbssid); ista->index = sta_idx; tsta.is_vif_sta = 0; maxampdu = 1 << (IEEE80211_HT_MAX_AMPDU_FACTOR + sta->ht_cap.ampdu_factor); tsta.maxampdu = cpu_to_be16(maxampdu); } else { - memcpy(&tsta.macaddr, vif->addr, ETH_ALEN); + ether_addr_copy(tsta.macaddr, vif->addr); tsta.is_vif_sta = 1; tsta.maxampdu = cpu_to_be16(0xffff); } @@ -1048,7 +1048,7 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw, ath9k_htc_ps_wakeup(priv); memset(&hvif, 0, sizeof(struct ath9k_htc_target_vif)); - memcpy(&hvif.myaddr, vif->addr, ETH_ALEN); + ether_addr_copy(hvif.myaddr, vif->addr); switch (vif->type) { case NL80211_IFTYPE_STATION: @@ -1131,7 +1131,7 @@ static void ath9k_htc_remove_interface(struct ieee80211_hw *hw, ath9k_htc_ps_wakeup(priv); memset(&hvif, 0, sizeof(struct ath9k_htc_target_vif)); - memcpy(&hvif.myaddr, vif->addr, ETH_ALEN); + ether_addr_copy(hvif.myaddr, vif->addr); hvif.index = avp->index; WMI_CMD_BUF(WMI_VAP_REMOVE_CMDID, &hvif); if (ret) { @@ -1493,7 +1493,7 @@ static void ath9k_htc_bss_iter(void *data, u8 *mac, struct ieee80211_vif *vif) if ((vif->type == NL80211_IFTYPE_STATION) && bss_conf->assoc) { common->curaid = bss_conf->aid; common->last_rssi = ATH_RSSI_DUMMY_MARKER; - memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN); + ether_addr_copy(common->curbssid, bss_conf->bssid); set_bit(ATH_OP_PRIM_STA_VIF, &common->op_flags); } } @@ -1543,7 +1543,7 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_IBSS) { if (priv->ah->opmode == NL80211_IFTYPE_ADHOC) { common->curaid = bss_conf->aid; - memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN); + ether_addr_copy(common->curbssid, bss_conf->bssid); ath9k_htc_set_bssid(priv); } }