diff mbox series

[net-next,2/5] net: mscc: ocelot: use ether_addr_copy

Message ID 20201029022738.722794-3-vladimir.oltean@nxp.com
State New
Headers show
Series L2 multicast forwarding for Ocelot switch | expand

Commit Message

Vladimir Oltean Oct. 29, 2020, 2:27 a.m. UTC
Since a helper is available for copying Ethernet addresses, let's use it.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/ethernet/mscc/ocelot.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Florian Fainelli Oct. 29, 2020, 2:32 a.m. UTC | #1
On 10/28/2020 7:27 PM, Vladimir Oltean wrote:
> Since a helper is available for copying Ethernet addresses, let's use it.

> 

> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>


Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

-- 
Florian
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
index 25152f1f2939..763d0277eeae 100644
--- a/drivers/net/ethernet/mscc/ocelot.c
+++ b/drivers/net/ethernet/mscc/ocelot.c
@@ -997,7 +997,7 @@  static void ocelot_encode_ports_to_mdb(unsigned char *addr,
 				       struct ocelot_multicast *mc,
 				       enum macaccess_entry_type entry_type)
 {
-	memcpy(addr, mc->addr, ETH_ALEN);
+	ether_addr_copy(addr, mc->addr);
 
 	if (entry_type == ENTRYTYPE_MACv4) {
 		addr[0] = 0;
@@ -1042,7 +1042,7 @@  int ocelot_port_mdb_add(struct ocelot *ocelot, int port,
 		if (!mc)
 			return -ENOMEM;
 
-		memcpy(mc->addr, mdb->addr, ETH_ALEN);
+		ether_addr_copy(mc->addr, mdb->addr);
 		mc->vid = vid;
 		mc->pgid = pgid;