summaryrefslogtreecommitdiff
path: root/include/linux/wait.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2013-10-02 11:22:25 +0200
committerIngo Molnar <mingo@kernel.org>2013-10-04 10:14:49 +0200
commitc2ebb1fb4eddf3d1d66fe31d1e89e83ee211b81c (patch)
treeafb9ff2c021bc22be45d3662da9f430f0df4f69f /include/linux/wait.h
parentf13f4c41c9cf9cd61c896e46e4e7ba2687e2af9c (diff)
sched/wait: Collapse __wait_event_interruptible_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.469616907@infradead.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/wait.h')
-rw-r--r--include/linux/wait.h18
1 files changed, 3 insertions, 15 deletions
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 39e4bbd2c735..a79fb15c1dd4 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -304,21 +304,9 @@ do { \
})
#define __wait_event_interruptible_timeout(wq, condition, ret) \
-do { \
- DEFINE_WAIT(__wait); \
- \
- for (;;) { \
- prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \
- if (___wait_cond_timeout(condition, ret)) \
- break; \
- if (signal_pending(current)) { \
- ret = -ERESTARTSYS; \
- break; \
- } \
- ret = schedule_timeout(ret); \
- } \
- finish_wait(&wq, &__wait); \
-} while (0)
+ ___wait_event(wq, ___wait_cond_timeout(condition, ret), \
+ TASK_INTERRUPTIBLE, 0, ret, \
+ ret = schedule_timeout(ret))
/**
* wait_event_interruptible_timeout - sleep until a condition gets true or a timeout elapses