Skip to content

Commit

Permalink
net: drivers: get ready for const netdev->dev_addr
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 go through appropriate helpers. We will make
netdev->dev_addr a const.

Make sure local references to netdev->dev_addr are constant.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Oct 24, 2021
1 parent 5520fb4 commit 8bc7823
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/net/macsec.c
Original file line number Diff line number Diff line change
@@ -250,7 +250,7 @@ static bool send_sci(const struct macsec_secy *secy)
(secy->n_rx_sc > 1 && !tx_sc->end_station && !tx_sc->scb);
}

static sci_t make_sci(u8 *addr, __be16 port)
static sci_t make_sci(const u8 *addr, __be16 port)
{
sci_t sci;

3 changes: 2 additions & 1 deletion drivers/net/macvlan.c
Original file line number Diff line number Diff line change
@@ -698,7 +698,8 @@ static int macvlan_stop(struct net_device *dev)
return 0;
}

static int macvlan_sync_address(struct net_device *dev, unsigned char *addr)
static int macvlan_sync_address(struct net_device *dev,
const unsigned char *addr)
{
struct macvlan_dev *vlan = netdev_priv(dev);
struct net_device *lowerdev = vlan->lowerdev;
4 changes: 2 additions & 2 deletions drivers/net/vmxnet3/vmxnet3_drv.c
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ MODULE_DEVICE_TABLE(pci, vmxnet3_pciid_table);
static int enable_mq = 1;

static void
vmxnet3_write_mac_addr(struct vmxnet3_adapter *adapter, u8 *mac);
vmxnet3_write_mac_addr(struct vmxnet3_adapter *adapter, const u8 *mac);

/*
* Enable/Disable the given intr
@@ -2806,7 +2806,7 @@ vmxnet3_quiesce_dev(struct vmxnet3_adapter *adapter)


static void
vmxnet3_write_mac_addr(struct vmxnet3_adapter *adapter, u8 *mac)
vmxnet3_write_mac_addr(struct vmxnet3_adapter *adapter, const u8 *mac)
{
u32 tmp;

0 comments on commit 8bc7823

Please sign in to comment.