Skip to content

Commit

Permalink
fddi: defxx,defza: use dev_addr_set()
Browse files Browse the repository at this point in the history
Commit 406f42f ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Acked-by: Maciej W. Rozycki <macro@orcam.me.uk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Oct 22, 2021
1 parent 2674e7e commit 1e9258c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions drivers/net/fddi/defxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ static int dfx_driver_init(struct net_device *dev, const char *print_name,
* dfx_ctl_set_mac_address.
*/

memcpy(dev->dev_addr, bp->factory_mac_addr, FDDI_K_ALEN);
dev_addr_set(dev, bp->factory_mac_addr);
if (dfx_bus_tc)
board_name = "DEFTA";
if (dfx_bus_eisa)
Expand Down Expand Up @@ -1474,7 +1474,7 @@ static int dfx_open(struct net_device *dev)
* address.
*/

memcpy(dev->dev_addr, bp->factory_mac_addr, FDDI_K_ALEN);
dev_addr_set(dev, bp->factory_mac_addr);

/* Clear local unicast/multicast address tables and counts */

Expand Down Expand Up @@ -2379,7 +2379,7 @@ static int dfx_ctl_set_mac_address(struct net_device *dev, void *addr)

/* Copy unicast address to driver-maintained structs and update count */

memcpy(dev->dev_addr, p_sockaddr->sa_data, FDDI_K_ALEN); /* update device struct */
dev_addr_set(dev, p_sockaddr->sa_data); /* update device struct */
memcpy(&bp->uc_table[0], p_sockaddr->sa_data, FDDI_K_ALEN); /* update driver struct */
bp->uc_count = 1;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/fddi/defza.c
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,7 @@ static int fza_probe(struct device *bdev)
goto err_out_irq;

fza_reads(&init->hw_addr, &hw_addr, sizeof(hw_addr));
memcpy(dev->dev_addr, &hw_addr, FDDI_K_ALEN);
dev_addr_set(dev, &hw_addr);

fza_reads(&init->rom_rev, &rom_rev, sizeof(rom_rev));
fza_reads(&init->fw_rev, &fw_rev, sizeof(fw_rev));
Expand Down

0 comments on commit 1e9258c

Please sign in to comment.