Commit a1dc6852ac5eecdcd3122ae01703183a3e88e979

Authored by Peter Zijlstra
Committed by Ingo Molnar
1 parent 8fbd88fa17

sched/wait: Collapse __wait_event_interruptible_lock_irq_timeout()

Reduce macro complexity by using the new ___wait_event() helper.
No change in behaviour, identical generated code.

Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20131002092528.759956109@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>

Showing 1 changed file with 6 additions and 19 deletions Side-by-side Diff

include/linux/wait.h
... ... @@ -763,25 +763,12 @@
763 763 __ret; \
764 764 })
765 765  
766   -#define __wait_event_interruptible_lock_irq_timeout(wq, condition, \
767   - lock, ret) \
768   -do { \
769   - DEFINE_WAIT(__wait); \
770   - \
771   - for (;;) { \
772   - prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \
773   - if (___wait_cond_timeout(condition, ret)) \
774   - break; \
775   - if (signal_pending(current)) { \
776   - ret = -ERESTARTSYS; \
777   - break; \
778   - } \
779   - spin_unlock_irq(&lock); \
780   - ret = schedule_timeout(ret); \
781   - spin_lock_irq(&lock); \
782   - } \
783   - finish_wait(&wq, &__wait); \
784   -} while (0)
  766 +#define __wait_event_interruptible_lock_irq_timeout(wq, condition, lock, ret) \
  767 + ___wait_event(wq, ___wait_cond_timeout(condition, ret), \
  768 + TASK_INTERRUPTIBLE, 0, ret, \
  769 + spin_unlock_irq(&lock); \
  770 + ret = schedule_timeout(ret); \
  771 + spin_lock_irq(&lock));
785 772  
786 773 /**
787 774 * wait_event_interruptible_lock_irq_timeout - sleep until a condition gets true or a timeout elapses.