netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivan Vecera <ivecera@redhat.com>
To: netdev@vger.kernel.org
Cc: rasesh.mody@qlogic.com
Subject: [PATCH net-next 01/19] bna: use ether_addr_copy instead of memcpy
Date: Wed, 10 Jun 2015 18:43:07 +0200	[thread overview]
Message-ID: <1433954605-22813-2-git-send-email-ivecera@redhat.com> (raw)
In-Reply-To: <1433954605-22813-1-git-send-email-ivecera@redhat.com>

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
---
 drivers/net/ethernet/brocade/bna/bna_tx_rx.c | 12 ++++++------
 drivers/net/ethernet/brocade/bna/bnad.c      | 14 ++++++--------
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/brocade/bna/bna_tx_rx.c b/drivers/net/ethernet/brocade/bna/bna_tx_rx.c
index 8ab3a5f..30d5e7f 100644
--- a/drivers/net/ethernet/brocade/bna/bna_tx_rx.c
+++ b/drivers/net/ethernet/brocade/bna/bna_tx_rx.c
@@ -876,7 +876,7 @@ bna_rx_ucast_set(struct bna_rx *rx, u8 *ucmac,
 		bfa_q_qe_init(&rxf->ucast_pending_mac->qe);
 	}
 
-	memcpy(rxf->ucast_pending_mac->addr, ucmac, ETH_ALEN);
+	ether_addr_copy(rxf->ucast_pending_mac->addr, ucmac);
 	rxf->ucast_pending_set = 1;
 	rxf->cam_fltr_cbfn = cbfn;
 	rxf->cam_fltr_cbarg = rx->bna->bnad;
@@ -905,7 +905,7 @@ bna_rx_mcast_add(struct bna_rx *rx, u8 *addr,
 	if (mac == NULL)
 		return BNA_CB_MCAST_LIST_FULL;
 	bfa_q_qe_init(&mac->qe);
-	memcpy(mac->addr, addr, ETH_ALEN);
+	ether_addr_copy(mac->addr, addr);
 	list_add_tail(&mac->qe, &rxf->mcast_pending_add_q);
 
 	rxf->cam_fltr_cbfn = cbfn;
@@ -955,7 +955,7 @@ bna_rx_ucast_listset(struct bna_rx *rx, int count, u8 *uclist,
 		if (mac == NULL)
 			goto err_return;
 		bfa_q_qe_init(&mac->qe);
-		memcpy(mac->addr, mcaddr, ETH_ALEN);
+		ether_addr_copy(mac->addr, mcaddr);
 		list_add_tail(&mac->qe, &list_head);
 		mcaddr += ETH_ALEN;
 	}
@@ -1026,7 +1026,7 @@ bna_rx_mcast_listset(struct bna_rx *rx, int count, u8 *mclist,
 		if (mac == NULL)
 			goto err_return;
 		bfa_q_qe_init(&mac->qe);
-		memcpy(mac->addr, mcaddr, ETH_ALEN);
+		ether_addr_copy(mac->addr, mcaddr);
 		list_add_tail(&mac->qe, &list_head);
 
 		mcaddr += ETH_ALEN;
@@ -1149,8 +1149,8 @@ bna_rxf_ucast_cfg_apply(struct bna_rxf *rxf)
 	/* Set default unicast MAC */
 	if (rxf->ucast_pending_set) {
 		rxf->ucast_pending_set = 0;
-		memcpy(rxf->ucast_active_mac.addr,
-			rxf->ucast_pending_mac->addr, ETH_ALEN);
+		ether_addr_copy(rxf->ucast_active_mac.addr,
+				rxf->ucast_pending_mac->addr);
 		rxf->ucast_active_set = 1;
 		bna_bfi_ucast_req(rxf, &rxf->ucast_active_mac,
 			BFI_ENET_H2I_MAC_UCAST_SET_REQ);
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index caae6cb..bb87c11 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -875,9 +875,9 @@ bnad_set_netdev_perm_addr(struct bnad *bnad)
 {
 	struct net_device *netdev = bnad->netdev;
 
-	memcpy(netdev->perm_addr, &bnad->perm_addr, netdev->addr_len);
+	ether_addr_copy(netdev->perm_addr, bnad->perm_addr.mac);
 	if (is_zero_ether_addr(netdev->dev_addr))
-		memcpy(netdev->dev_addr, &bnad->perm_addr, netdev->addr_len);
+		ether_addr_copy(netdev->dev_addr, bnad->perm_addr.mac);
 }
 
 /* Control Path Handlers */
@@ -1862,8 +1862,7 @@ bnad_netdev_mc_list_get(struct net_device *netdev, u8 *mc_list)
 	struct netdev_hw_addr *mc_addr;
 
 	netdev_for_each_mc_addr(mc_addr, netdev) {
-		memcpy(&mc_list[i * ETH_ALEN], &mc_addr->addr[0],
-							ETH_ALEN);
+		ether_addr_copy(&mc_list[i * ETH_ALEN], &mc_addr->addr[0]);
 		i++;
 	}
 }
@@ -3141,8 +3140,7 @@ bnad_set_rx_ucast_fltr(struct bnad *bnad)
 
 	entry = 0;
 	netdev_for_each_uc_addr(ha, netdev) {
-		memcpy(&mac_list[entry * ETH_ALEN],
-		       &ha->addr[0], ETH_ALEN);
+		ether_addr_copy(&mac_list[entry * ETH_ALEN], &ha->addr[0]);
 		entry++;
 	}
 
@@ -3183,7 +3181,7 @@ bnad_set_rx_mcast_fltr(struct bnad *bnad)
 	if (mac_list == NULL)
 		goto mode_allmulti;
 
-	memcpy(&mac_list[0], &bnad_bcast_addr[0], ETH_ALEN);
+	ether_addr_copy(&mac_list[0], &bnad_bcast_addr[0]);
 
 	/* copy rest of the MCAST addresses */
 	bnad_netdev_mc_list_get(netdev, mac_list);
@@ -3260,7 +3258,7 @@ bnad_set_mac_address(struct net_device *netdev, void *mac_addr)
 	err = bnad_mac_addr_set_locked(bnad, sa->sa_data);
 
 	if (!err)
-		memcpy(netdev->dev_addr, sa->sa_data, netdev->addr_len);
+		ether_addr_copy(netdev->dev_addr, sa->sa_data);
 
 	spin_unlock_irqrestore(&bnad->bna_lock, flags);
 
-- 
2.3.6

  reply	other threads:[~2015-06-10 16:42 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-10 16:43 [PATCH net-next 00/19] bna: clean-up Ivan Vecera
2015-06-10 16:43 ` Ivan Vecera [this message]
2015-06-10 17:57   ` [PATCH net-next 01/19] bna: use ether_addr_copy instead of memcpy Joe Perches
2015-06-11 13:31     ` Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 02/19] bna: get rid of mac_t Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 03/19] bna: replace pragma(pack) with attribute __packed Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 04/19] bna: get rid of duplicate and unused macros Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 05/19] bna: use BIT(x) instead of (1 << x) Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 06/19] bna: remove unused cbfn parameter Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 07/19] bna: remove pause_cbfn from struct bna_enet Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 08/19] bna: remove oper_state_cbfn from struct bna_rxf Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 09/19] bna: remove prio_change_cbfn oper_state_cbfn from struct bna_tx Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 10/19] bna: remove RXF_E_PAUSE and RXF_E_RESUME events Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 11/19] bna: remove paused from bna_rx_config and flags from bna_rxf Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 12/19] bna: remove TX_E_PRIO_CHANGE event and BNA_TX_F_PRIO_CHANGED flag Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 13/19] bna: correct comparisons/assignments to bool Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 14/19] bna: use memdup_user to copy userspace buffers Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 15/19] bna: remove useless pointer assignment Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 16/19] bna: get rid of private macros for manipulation with lists Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 17/19] bna: use list_for_each_entry where appropriate Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 18/19] bna: fix timeout API argument type Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 19/19] bna: use netdev_* and dev_* instead of printk and pr_* Ivan Vecera
2015-06-10 20:29   ` Joe Perches
2015-06-11  9:43     ` Ivan Vecera
2015-06-11 16:36       ` Joe Perches

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=1433954605-22813-2-git-send-email-ivecera@redhat.com \
    --to=ivecera@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=rasesh.mody@qlogic.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;
as well as URLs for NNTP newsgroup(s).