]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: drivers: get ready for const netdev->dev_addr
authorJakub Kicinski <kuba@kernel.org>
Fri, 22 Oct 2021 23:21:02 +0000 (16:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 24 Oct 2021 12:59:45 +0000 (13:59 +0100)
Commit 406f42fa0d3c ("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>
drivers/net/macsec.c
drivers/net/macvlan.c
drivers/net/vmxnet3/vmxnet3_drv.c

index 18b6dba9394e8b42025e3cdab057dcbfd8bc605c..16aa3a478e9e8d15ed14e3d62ca3a1e539e99993 100644 (file)
@@ -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;
 
index 6189acb33973c65cd5b913effb13d1f8da31c35e..d2f830ec2969c961efeb167e2b8ed5cc7c41da74 100644 (file)
@@ -698,7 +698,8 @@ hash_del:
        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;
index 7a205ddf0060a3de8daf4b4984f407e7a73e2a3b..3e1b7746cce444e9fbb799323644e4a14f697b2c 100644 (file)
@@ -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;