staging: qlge: use eth_hw_addr_set()
authorJakub Kicinski <kuba@kernel.org>
Tue, 19 Oct 2021 17:12:39 +0000 (10:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Oct 2021 17:33:58 +0000 (19:33 +0200)
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 got through appropriate helpers.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20211019171243.1412240-5-kuba@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/qlge/qlge_main.c
drivers/staging/qlge/qlge_mpi.c

index abb7844..ee6b49c 100644 (file)
@@ -321,8 +321,8 @@ int qlge_get_mac_addr_reg(struct qlge_adapter *qdev, u32 type, u16 index,
 /* Set up a MAC, multicast or VLAN address for the
  * inbound frame matching.
  */
-static int qlge_set_mac_addr_reg(struct qlge_adapter *qdev, u8 *addr, u32 type,
-                                u16 index)
+static int qlge_set_mac_addr_reg(struct qlge_adapter *qdev, const u8 *addr,
+                                u32 type, u16 index)
 {
        u32 offset = 0;
        int status = 0;
@@ -441,7 +441,7 @@ static int qlge_set_mac_addr(struct qlge_adapter *qdev, int set)
        status = qlge_sem_spinlock(qdev, SEM_MAC_ADDR_MASK);
        if (status)
                return status;
-       status = qlge_set_mac_addr_reg(qdev, (u8 *)addr,
+       status = qlge_set_mac_addr_reg(qdev, (const u8 *)addr,
                                       MAC_ADDR_TYPE_CAM_MAC,
                                       qdev->func * MAX_CQ);
        qlge_sem_unlock(qdev, SEM_MAC_ADDR_MASK);
@@ -4217,7 +4217,7 @@ static int qlge_set_mac_address(struct net_device *ndev, void *p)
        status = qlge_sem_spinlock(qdev, SEM_MAC_ADDR_MASK);
        if (status)
                return status;
-       status = qlge_set_mac_addr_reg(qdev, (u8 *)ndev->dev_addr,
+       status = qlge_set_mac_addr_reg(qdev, (const u8 *)ndev->dev_addr,
                                       MAC_ADDR_TYPE_CAM_MAC,
                                       qdev->func * MAX_CQ);
        if (status)
index 2630ebf..96a4de6 100644 (file)
@@ -862,7 +862,7 @@ int qlge_mb_wol_set_magic(struct qlge_adapter *qdev, u32 enable_wol)
        struct mbox_params mbc;
        struct mbox_params *mbcp = &mbc;
        int status;
-       u8 *addr = qdev->ndev->dev_addr;
+       const u8 *addr = qdev->ndev->dev_addr;
 
        memset(mbcp, 0, sizeof(struct mbox_params));