Skip to content

Commit a0470a9

Browse files
committed
um: vector: remove vp->lock
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 <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent 86abcd6 commit a0470a9

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

arch/um/drivers/vector_kern.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,6 @@ static int irq_rr;
11151115
static int vector_net_close(struct net_device *dev)
11161116
{
11171117
struct vector_private *vp = netdev_priv(dev);
1118-
unsigned long flags;
11191118

11201119
netif_stop_queue(dev);
11211120
del_timer(&vp->tl);
@@ -1158,10 +1157,8 @@ static int vector_net_close(struct net_device *dev)
11581157
destroy_queue(vp->tx_queue);
11591158
kfree(vp->fds);
11601159
vp->fds = NULL;
1161-
spin_lock_irqsave(&vp->lock, flags);
11621160
vp->opened = false;
11631161
vp->in_error = false;
1164-
spin_unlock_irqrestore(&vp->lock, flags);
11651162
return 0;
11661163
}
11671164

@@ -1203,17 +1200,12 @@ static void vector_reset_tx(struct work_struct *work)
12031200
static int vector_net_open(struct net_device *dev)
12041201
{
12051202
struct vector_private *vp = netdev_priv(dev);
1206-
unsigned long flags;
12071203
int err = -EINVAL;
12081204
struct vector_device *vdevice;
12091205

1210-
spin_lock_irqsave(&vp->lock, flags);
1211-
if (vp->opened) {
1212-
spin_unlock_irqrestore(&vp->lock, flags);
1206+
if (vp->opened)
12131207
return -ENXIO;
1214-
}
12151208
vp->opened = true;
1216-
spin_unlock_irqrestore(&vp->lock, flags);
12171209

12181210
vp->bpf = uml_vector_user_bpf(get_bpf_file(vp->parsed));
12191211

@@ -1387,8 +1379,6 @@ static int vector_net_load_bpf_flash(struct net_device *dev,
13871379
return -1;
13881380
}
13891381

1390-
spin_lock(&vp->lock);
1391-
13921382
if (vp->bpf != NULL) {
13931383
if (vp->opened)
13941384
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,
14171407
if (vp->opened)
14181408
result = uml_vector_attach_bpf(vp->fds->rx_fd, vp->bpf);
14191409

1420-
spin_unlock(&vp->lock);
1421-
14221410
return result;
14231411

14241412
free_buffer:
14251413
release_firmware(fw);
14261414

14271415
flash_fail:
1428-
spin_unlock(&vp->lock);
14291416
if (vp->bpf != NULL)
14301417
kfree(vp->bpf->filter);
14311418
kfree(vp->bpf);
@@ -1631,7 +1618,6 @@ static void vector_eth_configure(
16311618
INIT_WORK(&vp->reset_tx, vector_reset_tx);
16321619

16331620
timer_setup(&vp->tl, vector_timer_expire, 0);
1634-
spin_lock_init(&vp->lock);
16351621

16361622
/* FIXME */
16371623
dev->netdev_ops = &vector_netdev_ops;

arch/um/drivers/vector_kern.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ struct vector_estats {
7171

7272
struct vector_private {
7373
struct list_head list;
74-
spinlock_t lock;
7574
struct net_device *dev;
7675
struct napi_struct napi ____cacheline_aligned;
7776

0 commit comments

Comments
 (0)