diff options
author | Jakub Kicinski | 2021-10-08 10:59:12 -0700 |
---|---|---|
committer | David S. Miller | 2021-10-09 11:46:57 +0100 |
commit | a7639279c93c1e07a703c0f86f0831d4ea2314f0 (patch) | |
tree | be20c9534bb19d4d13cb01d5f1c58272ccc865ef /drivers/net/ethernet/sun/sunhme.c | |
parent | ca87931755648655e4b57806deefe5c5d38024de (diff) |
ethernet: sun: remove direct netdev->dev_addr writes
Consify temporary variables pointing to netdev->dev_addr.
A few places need local storage but pretty simple conversion
over all. Note that macaddr[] is an array of ints, so we need
to keep the loops.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sun/sunhme.c')
-rw-r--r-- | drivers/net/ethernet/sun/sunhme.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index fe5482b1872f..ad9029ae6848 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -1395,13 +1395,13 @@ force_link: /* hp->happy_lock must be held */ static int happy_meal_init(struct happy_meal *hp) { + const unsigned char *e = &hp->dev->dev_addr[0]; void __iomem *gregs = hp->gregs; void __iomem *etxregs = hp->etxregs; void __iomem *erxregs = hp->erxregs; void __iomem *bregs = hp->bigmacregs; void __iomem *tregs = hp->tcvregs; u32 regtmp, rxcfg; - unsigned char *e = &hp->dev->dev_addr[0]; /* If auto-negotiation timer is running, kill it. */ del_timer(&hp->happy_timer); @@ -2661,6 +2661,7 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) struct happy_meal *hp; struct net_device *dev; int i, qfe_slot = -1; + u8 addr[ETH_ALEN]; int err = -ENODEV; sbus_dp = op->dev.parent->of_node; @@ -2698,7 +2699,8 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) } if (i < 6) { /* a mac address was given */ for (i = 0; i < 6; i++) - dev->dev_addr[i] = macaddr[i]; + addr[i] = macaddr[i]; + eth_hw_addr_set(dev, addr); macaddr[5]++; } else { const unsigned char *addr; @@ -2969,6 +2971,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, unsigned long hpreg_res; int i, qfe_slot = -1; char prom_name[64]; + u8 addr[ETH_ALEN]; int err; /* Now make sure pci_dev cookie is there. */ @@ -3044,7 +3047,8 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, } if (i < 6) { /* a mac address was given */ for (i = 0; i < 6; i++) - dev->dev_addr[i] = macaddr[i]; + addr[i] = macaddr[i]; + eth_hw_addr_set(dev, addr); macaddr[5]++; } else { #ifdef CONFIG_SPARC @@ -3060,7 +3064,10 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, eth_hw_addr_set(dev, idprom->id_ethaddr); } #else - get_hme_mac_nonsparc(pdev, &dev->dev_addr[0]); + u8 addr[ETH_ALEN]; + + get_hme_mac_nonsparc(pdev, addr); + eth_hw_addr_set(dev, addr); #endif } |