net: mscc: ocelot: use ether_addr_copy
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 29 Oct 2020 02:27:35 +0000 (04:27 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 31 Oct 2020 01:25:56 +0000 (18:25 -0700)
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>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mscc/ocelot.c

index 25152f1f2939a0e610d93f770ba3d6d377081db3..763d0277eeaed5eb85f3b1ed82a3ec032257d3a5 100644 (file)
@@ -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;