mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shyam Saini <mayhs11saini@gmail.com>
To: johnny.kim@atmel.com
Cc: austin.shin@atmel.com, chris.park@atmel.com, tony.cho@atmel.com,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	linux-wireless@vger.kernel.org,
	Shyam Saini <mayhs11saini@gmail.com>
Subject: [PATCH 525/525] Staging: Wilc1000: Fixed coding style ether_addr_copy
Date: Thu,  7 Apr 2016 15:07:15 +0530	[thread overview]
Message-ID: <1460021835-8370-1-git-send-email-mayhs11saini@gmail.com> (raw)

Fixed following warning detected by checkpatch.pl:
warning: Prefer ether_addr_copy() over memcpy() if the Ethernet addressesare __aligned(2)

Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 25 +++++++++++------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index b76622d..3a5d04a 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -363,8 +363,8 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
 	last_scanned_shadow[ap_index].ssid_len = pstrNetworkInfo->ssid_len;
 	memcpy(last_scanned_shadow[ap_index].ssid,
 	       pstrNetworkInfo->ssid, pstrNetworkInfo->ssid_len);
-	memcpy(last_scanned_shadow[ap_index].bssid,
-	       pstrNetworkInfo->bssid, ETH_ALEN);
+	ether_addr_copy(last_scanned_shadow[ap_index].bssid,
+	       pstrNetworkInfo->bssid);
 	last_scanned_shadow[ap_index].beacon_period = pstrNetworkInfo->beacon_period;
 	last_scanned_shadow[ap_index].dtim_period = pstrNetworkInfo->dtim_period;
 	last_scanned_shadow[ap_index].ch = pstrNetworkInfo->ch;
@@ -521,7 +521,7 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent,
 			bool bNeedScanRefresh = false;
 			u32 i;
 
-			memcpy(priv->au8AssociatedBss, pstrConnectInfo->bssid, ETH_ALEN);
+			ether_addr_copy(priv->au8AssociatedBss, pstrConnectInfo->bssid);
 
 
 			for (i = 0; i < last_scanned_cnt; i++) {
@@ -1000,7 +1000,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
 						g_add_gtk_key_params.mac_addr = NULL;
 					} else {
 						g_add_gtk_key_params.mac_addr = kmalloc(ETH_ALEN, GFP_KERNEL);
-						memcpy(g_add_gtk_key_params.mac_addr, mac_addr, ETH_ALEN);
+						ether_addr_copy(g_add_gtk_key_params.mac_addr, mac_addr);
 					}
 					g_key_gtk_params.key_len = params->key_len;
 					g_key_gtk_params.seq_len = params->seq_len;
@@ -1033,7 +1033,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
 						g_add_ptk_key_params.mac_addr = NULL;
 					} else {
 						g_add_ptk_key_params.mac_addr = kmalloc(ETH_ALEN, GFP_KERNEL);
-						memcpy(g_add_ptk_key_params.mac_addr, mac_addr, ETH_ALEN);
+						ether_addr_copy(g_add_ptk_key_params.mac_addr, mac_addr);
 					}
 					g_key_ptk_params.key_len = params->key_len;
 					g_key_ptk_params.seq_len = params->seq_len;
@@ -1287,8 +1287,8 @@ static int set_pmksa(struct wiphy *wiphy, struct net_device *netdev,
 		}
 	}
 	if (i < WILC_MAX_NUM_PMKIDS) {
-		memcpy(priv->pmkid_list.pmkidlist[i].bssid, pmksa->bssid,
-			    ETH_ALEN);
+		ether_addr_copy(priv->pmkid_list.pmkidlist[i].bssid,
+				pmksa->bssid);
 		memcpy(priv->pmkid_list.pmkidlist[i].pmkid, pmksa->pmkid,
 			    PMKID_LEN);
 		if (!(flag == PMKID_FOUND))
@@ -1322,9 +1322,8 @@ static int del_pmksa(struct wiphy *wiphy, struct net_device *netdev,
 
 	if (i < priv->pmkid_list.numpmkid && priv->pmkid_list.numpmkid > 0) {
 		for (; i < (priv->pmkid_list.numpmkid - 1); i++) {
-			memcpy(priv->pmkid_list.pmkidlist[i].bssid,
-				    priv->pmkid_list.pmkidlist[i + 1].bssid,
-				    ETH_ALEN);
+			ether_addr_copy(priv->pmkid_list.pmkidlist[i].bssid,
+				    priv->pmkid_list.pmkidlist[i + 1].bssid);
 			memcpy(priv->pmkid_list.pmkidlist[i].pmkid,
 				    priv->pmkid_list.pmkidlist[i].pmkid,
 				    PMKID_LEN);
@@ -1983,8 +1982,8 @@ static int add_station(struct wiphy *wiphy, struct net_device *dev,
 	vif = netdev_priv(dev);
 
 	if (vif->iftype == AP_MODE || vif->iftype == GO_MODE) {
-		memcpy(strStaParams.bssid, mac, ETH_ALEN);
-		memcpy(priv->assoc_stainfo.au8Sta_AssociatedBss[params->aid], mac, ETH_ALEN);
+		ether_addr_copy(strStaParams.bssid, mac);
+		ether_addr_copy(priv->assoc_stainfo.au8Sta_AssociatedBss[params->aid], mac);
 		strStaParams.aid = params->aid;
 		strStaParams.rates_len = params->supported_rates_len;
 		strStaParams.rates = params->supported_rates;
@@ -2056,7 +2055,7 @@ static int change_station(struct wiphy *wiphy, struct net_device *dev,
 	vif = netdev_priv(dev);
 
 	if (vif->iftype == AP_MODE || vif->iftype == GO_MODE) {
-		memcpy(strStaParams.bssid, mac, ETH_ALEN);
+		ether_addr_copy(strStaParams.bssid, mac);
 		strStaParams.aid = params->aid;
 		strStaParams.rates_len = params->supported_rates_len;
 		strStaParams.rates = params->supported_rates;
-- 
1.9.1

             reply	other threads:[~2016-04-07  9:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-07  9:37 Shyam Saini [this message]
2016-04-07 11:00 ` Joe Perches
2016-04-07 14:49 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460021835-8370-1-git-send-email-mayhs11saini@gmail.com \
    --to=mayhs11saini@gmail.com \
    --cc=austin.shin@atmel.com \
    --cc=chris.park@atmel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=johnny.kim@atmel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=tony.cho@atmel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®