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: poller - convert locking to guard notation

Use guard() notation instead of explicitly acquiring and releasing
mutex to simplify the code and ensure that it is released.

Link: https://lore.kernel.org/r/20241107071538.195340-8-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+1 -3
+1 -3
drivers/input/input-poller.c
··· 162 162 if (interval > poller->poll_interval_max) 163 163 return -EINVAL; 164 164 165 - mutex_lock(&input->mutex); 165 + guard(mutex)(&input->mutex); 166 166 167 167 poller->poll_interval = interval; 168 168 ··· 171 171 if (poller->poll_interval > 0) 172 172 input_dev_poller_queue_work(poller); 173 173 } 174 - 175 - mutex_unlock(&input->mutex); 176 174 177 175 return count; 178 176 }