| From: Jakub Kicinski <kuba@kernel.org> |
| Date: Fri, 1 Oct 2021 14:32:25 -0700 |
| Subject: ethernet: chelsio: use eth_hw_addr_set() |
| Patch-mainline: v5.16-rc1 |
| Git-commit: 47d71f45902ea4a870174b72b66fd82b7248854d |
| References: jsc#SLE-18992 |
| |
| 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> |
| Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de> |
| |
| drivers/net/ethernet/chelsio/cxgb/subr.c | 2 +- |
| drivers/net/ethernet/chelsio/cxgb3/t3_hw.c | 4 ++-- |
| drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 2 +- |
| drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 2 +- |
| drivers/net/ethernet/chelsio/cxgb4vf/adapter.h | 3 ++- |
| 5 files changed, 7 insertions(+), 6 deletions(-) |
| |
| |
| |
| @@ -1140,7 +1140,7 @@ int t1_init_sw_modules(adapter_t *adapte |
| 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); |
| } |
| |
| |
| |
| @@ -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 *adap |
| 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); |
| |
| |
| |
| @@ -1545,7 +1545,7 @@ static inline void t4_write_reg64(struct |
| 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); |
| } |
| |
| |
| |
| @@ -9709,7 +9709,7 @@ int t4_port_init(struct adapter *adap, i |
| if (ret) |
| return ret; |
| |
| - memcpy(adap->port[i]->dev_addr, addr, ETH_ALEN); |
| + eth_hw_addr_set(adap->port[i], addr); |
| j++; |
| } |
| return 0; |
| |
| |
| @@ -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(stru |
| 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); |
| } |
| |
| /** |