ethernet: chelsio: use eth_hw_addr_set()
authorJakub Kicinski <kuba@kernel.org>
Fri, 1 Oct 2021 21:32:25 +0000 (14:32 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 2 Oct 2021 13:18:25 +0000 (14:18 +0100)
Convert chelsio drivers from memcpy() and ether_addr_copy()
to eth_hw_addr_set(). They lack includes.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb/subr.c
drivers/net/ethernet/chelsio/cxgb3/t3_hw.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
drivers/net/ethernet/chelsio/cxgb4vf/adapter.h

index 310add28fcf590036a51ea0e12e9e98f041d4aae..007c591b8bf5f89c2ace89b1a7c4caa5895aa76e 100644 (file)
@@ -1140,7 +1140,7 @@ int t1_init_sw_modules(adapter_t *adapter, const struct board_info *bi)
                               adapter->port[i].dev->name);
                        goto error;
                }
-               memcpy(adapter->port[i].dev->dev_addr, hw_addr, ETH_ALEN);
+               eth_hw_addr_set(adapter->port[i].dev, hw_addr);
                init_link_config(&adapter->port[i].link_config, bi);
        }
 
index 7ff31d1026fb27a4edc8af073b36927c675c8fe7..53feac8da503f6478ce043554faa31894eb46b2f 100644 (file)
@@ -29,6 +29,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
+#include <linux/etherdevice.h>
 #include "common.h"
 #include "regs.h"
 #include "sge_defs.h"
@@ -3758,8 +3759,7 @@ int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai,
                memcpy(hw_addr, adapter->params.vpd.eth_base, 5);
                hw_addr[5] = adapter->params.vpd.eth_base[5] + i;
 
-               memcpy(adapter->port[i]->dev_addr, hw_addr,
-                      ETH_ALEN);
+               eth_hw_addr_set(adapter->port[i], hw_addr);
                init_link_config(&p->link_config, p->phy.caps);
                p->phy.ops->power_down(&p->phy, 1);
 
index ecea3cdd30b3f77e2477d1c722548e5a72e5a0ba..5657ac8cfca001eff07e8483711ce4b0d594f949 100644 (file)
@@ -1545,7 +1545,7 @@ static inline void t4_write_reg64(struct adapter *adap, u32 reg_addr, u64 val)
 static inline void t4_set_hw_addr(struct adapter *adapter, int port_idx,
                                  u8 hw_addr[])
 {
-       ether_addr_copy(adapter->port[port_idx]->dev_addr, hw_addr);
+       eth_hw_addr_set(adapter->port[port_idx], hw_addr);
        ether_addr_copy(adapter->port[port_idx]->perm_addr, hw_addr);
 }
 
index 64144b6171d722938b46442907823b6599674a00..e7b4e3ed056c725cb832302c2efec6d0416a283d 100644 (file)
@@ -9706,7 +9706,7 @@ int t4_port_init(struct adapter *adap, int mbox, int pf, int vf)
                if (ret)
                        return ret;
 
-               memcpy(adap->port[i]->dev_addr, addr, ETH_ALEN);
+               eth_hw_addr_set(adap->port[i], addr);
                j++;
        }
        return 0;
index f55105a4112fd683fdcb765c9a5e7dece89c970c..03cb1410d6fc31145fe66821df08943e9629c1e0 100644 (file)
@@ -40,6 +40,7 @@
 #ifndef __CXGB4VF_ADAPTER_H__
 #define __CXGB4VF_ADAPTER_H__
 
+#include <linux/etherdevice.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/spinlock.h>
@@ -507,7 +508,7 @@ static inline const char *port_name(struct adapter *adapter, int pidx)
 static inline void t4_os_set_hw_addr(struct adapter *adapter, int pidx,
                                     u8 hw_addr[])
 {
-       memcpy(adapter->port[pidx]->dev_addr, hw_addr, ETH_ALEN);
+       eth_hw_addr_set(adapter->port[pidx], hw_addr);
 }
 
 /**