diff options
author | 2024-11-06 23:15:32 -0800 | |
---|---|---|
committer | 2024-12-23 22:53:57 -0800 | |
commit | 4e3929ce6cc13b50e3975e8b243d2fcb17b63c64 (patch) | |
tree | d3df8b254f6fc10e09c42357f471700d2cbf4efd | |
parent | Input: ff-memless - make use of __free() cleanup facility (diff) | |
download | wireguard-linux-4e3929ce6cc13b50e3975e8b243d2fcb17b63c64.tar.xz wireguard-linux-4e3929ce6cc13b50e3975e8b243d2fcb17b63c64.zip |
Input: mt - convert locking to guard notation
Use guard() notation instead of explicitly acquiring and releasing
spinlocks to simplify the code and ensure that all locks are released.
Link: https://lore.kernel.org/r/20241107071538.195340-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/input/input-mt.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c index 6b04a674f832..45e41fc9059c 100644 --- a/drivers/input/input-mt.c +++ b/drivers/input/input-mt.c @@ -285,14 +285,10 @@ void input_mt_drop_unused(struct input_dev *dev) struct input_mt *mt = dev->mt; if (mt) { - unsigned long flags; - - spin_lock_irqsave(&dev->event_lock, flags); + guard(spinlock_irqsave)(&dev->event_lock); __input_mt_drop_unused(dev, mt); mt->frame++; - - spin_unlock_irqrestore(&dev->event_lock, flags); } } EXPORT_SYMBOL(input_mt_drop_unused); @@ -339,11 +335,8 @@ void input_mt_sync_frame(struct input_dev *dev) return; if (mt->flags & INPUT_MT_DROP_UNUSED) { - unsigned long flags; - - spin_lock_irqsave(&dev->event_lock, flags); + guard(spinlock_irqsave)(&dev->event_lock); __input_mt_drop_unused(dev, mt); - spin_unlock_irqrestore(&dev->event_lock, flags); } if ((mt->flags & INPUT_MT_POINTER) && !(mt->flags & INPUT_MT_SEMI_MT)) |