]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
um: vector: remove vp->lock
authorJohannes Berg <johannes.berg@intel.com>
Wed, 3 Jul 2024 16:46:07 +0000 (18:46 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 4 Jul 2024 10:03:23 +0000 (12:03 +0200)
This lock is useless, all the places that are using
it for some locking will already hold the RTNL. Just
remove it.

Link: https://patch.msgid.link/20240703184606.19aa35b14959.I9cf5f2c4e35abd06cc89bf2e990fa755eb8e5f0f@changeid
Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
arch/um/drivers/vector_kern.c
arch/um/drivers/vector_kern.h

index 4279793b11b71531b898029e3a5e0d86a5b90867..0861e32d2fbdc657a555e0cd057d0d2abd067176 100644 (file)
@@ -1115,7 +1115,6 @@ static int irq_rr;
 static int vector_net_close(struct net_device *dev)
 {
        struct vector_private *vp = netdev_priv(dev);
-       unsigned long flags;
 
        netif_stop_queue(dev);
        del_timer(&vp->tl);
@@ -1158,10 +1157,8 @@ static int vector_net_close(struct net_device *dev)
                destroy_queue(vp->tx_queue);
        kfree(vp->fds);
        vp->fds = NULL;
-       spin_lock_irqsave(&vp->lock, flags);
        vp->opened = false;
        vp->in_error = false;
-       spin_unlock_irqrestore(&vp->lock, flags);
        return 0;
 }
 
@@ -1203,17 +1200,12 @@ static void vector_reset_tx(struct work_struct *work)
 static int vector_net_open(struct net_device *dev)
 {
        struct vector_private *vp = netdev_priv(dev);
-       unsigned long flags;
        int err = -EINVAL;
        struct vector_device *vdevice;
 
-       spin_lock_irqsave(&vp->lock, flags);
-       if (vp->opened) {
-               spin_unlock_irqrestore(&vp->lock, flags);
+       if (vp->opened)
                return -ENXIO;
-       }
        vp->opened = true;
-       spin_unlock_irqrestore(&vp->lock, flags);
 
        vp->bpf = uml_vector_user_bpf(get_bpf_file(vp->parsed));
 
@@ -1387,8 +1379,6 @@ static int vector_net_load_bpf_flash(struct net_device *dev,
                return -1;
        }
 
-       spin_lock(&vp->lock);
-
        if (vp->bpf != NULL) {
                if (vp->opened)
                        uml_vector_detach_bpf(vp->fds->rx_fd, vp->bpf);
@@ -1417,15 +1407,12 @@ static int vector_net_load_bpf_flash(struct net_device *dev,
        if (vp->opened)
                result = uml_vector_attach_bpf(vp->fds->rx_fd, vp->bpf);
 
-       spin_unlock(&vp->lock);
-
        return result;
 
 free_buffer:
        release_firmware(fw);
 
 flash_fail:
-       spin_unlock(&vp->lock);
        if (vp->bpf != NULL)
                kfree(vp->bpf->filter);
        kfree(vp->bpf);
@@ -1631,7 +1618,6 @@ static void vector_eth_configure(
        INIT_WORK(&vp->reset_tx, vector_reset_tx);
 
        timer_setup(&vp->tl, vector_timer_expire, 0);
-       spin_lock_init(&vp->lock);
 
        /* FIXME */
        dev->netdev_ops = &vector_netdev_ops;
index 2a1fa8e0f3e149c6f5617251d0bf8ef51975fcd1..806df551be0b456bd2676022b745ae0221b20bdf 100644 (file)
@@ -71,7 +71,6 @@ struct vector_estats {
 
 struct vector_private {
        struct list_head list;
-       spinlock_t lock;
        struct net_device *dev;
        struct napi_struct              napi    ____cacheline_aligned;