posix-timers: Use spin_lock_irq() in itimer_delete()

itimer_delete() uses spin_lock_irqsave() to obtain a `flags' variable
which can then be passed to unlock_timer(). It uses already spin_lock
locking for the structure instead of lock_timer() because it has a timer
which can not be removed by others at this point. The cleanup is always
performed with enabled interrupts.

Use spin_lock_irq() / spin_unlock_irq() so the `flags' variable can be
removed.

Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
This commit is contained in:
Sebastian Andrzej Siewior authored and Thomas Gleixner committed 2019-06-22 12:14:22 +02:00
1 parent 12063d4310
commit 7586addb99
1 file changed
+3 -5
+3 -5
View File
@@ -980,18 +980,16 @@ retry_delete:
*/
static void itimer_delete(struct k_itimer *timer)
{
unsigned long flags;
retry_delete:
spin_lock_irqsave(&timer->it_lock, flags);
spin_lock_irq(&timer->it_lock);
if (timer_delete_hook(timer) == TIMER_RETRY) {
unlock_timer(timer, flags);
spin_unlock_irq(&timer->it_lock);
goto retry_delete;
}
list_del(&timer->list);
unlock_timer(timer, flags);
spin_unlock_irq(&timer->it_lock);
release_posix_timer(timer, IT_ID_SET);
}