Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+2 -9
+2 -9
drivers/input/input-mt.c
··· 285 285 struct input_mt *mt = dev->mt; 286 286 287 287 if (mt) { 288 - unsigned long flags; 289 - 290 - spin_lock_irqsave(&dev->event_lock, flags); 288 + guard(spinlock_irqsave)(&dev->event_lock); 291 289 292 290 __input_mt_drop_unused(dev, mt); 293 291 mt->frame++; 294 - 295 - spin_unlock_irqrestore(&dev->event_lock, flags); 296 292 } 297 293 } 298 294 EXPORT_SYMBOL(input_mt_drop_unused); ··· 335 339 return; 336 340 337 341 if (mt->flags & INPUT_MT_DROP_UNUSED) { 338 - unsigned long flags; 339 - 340 - spin_lock_irqsave(&dev->event_lock, flags); 342 + guard(spinlock_irqsave)(&dev->event_lock); 341 343 __input_mt_drop_unused(dev, mt); 342 - spin_unlock_irqrestore(&dev->event_lock, flags); 343 344 } 344 345 345 346 if ((mt->flags & INPUT_MT_POINTER) && !(mt->flags & INPUT_MT_SEMI_MT))