Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH] ice: Use ether_addr_copy() instead of memcpy
@ 2021-08-06 16:58 Brett Creeley
  0 siblings, 0 replies; only message in thread
From: Brett Creeley @ 2021-08-06 16:58 UTC (permalink / raw)
  To: intel-wired-lan

To save the netdev->dev_addr the driver is using memcpy with the length
of a MAC address. ether_addr_copy() is meant specifically for this, so
use it.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index b85e34caa619..ddabbd186e47 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -5221,7 +5221,7 @@ static int ice_set_mac_address(struct net_device *netdev, void *pi)
 		 * modified outside of the driver and needs to be restored back
 		 * to this value.
 		 */
-		memcpy(netdev->dev_addr, mac, netdev->addr_len);
+		ether_addr_copy(netdev->dev_addr, mac);
 		netdev_dbg(netdev, "filter for MAC %pM already exists\n", mac);
 		return 0;
 	}
@@ -5238,7 +5238,7 @@ static int ice_set_mac_address(struct net_device *netdev, void *pi)
 	}
 
 	/* change the netdev's MAC address */
-	memcpy(netdev->dev_addr, mac, netdev->addr_len);
+	ether_addr_copy(netdev->dev_addr, mac);
 	netdev_dbg(vsi->netdev, "updated MAC address to %pM\n",
 		   netdev->dev_addr);
 
-- 
2.26.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-06 16:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-06 16:58 [Intel-wired-lan] [PATCH] ice: Use ether_addr_copy() instead of memcpy Brett Creeley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox