aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tty.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2013-10-02 05:22:18 -0400
committerIngo Molnar <mingo@kernel.org>2013-10-04 04:14:44 -0400
commit2f2a2b60adf368bacd6acd2116c01e32caf936c4 (patch)
treeec7b7bac11365f1d0ae1a2d258429e265f27445d /include/linux/tty.h
parent75f93fed50c2abadbab6ef546b265f51ca975b27 (diff)
sched/wait: Make the signal_pending() checks consistent
There's two patterns to check signals in the __wait_event*() macros: if (!signal_pending(current)) { schedule(); continue; } ret = -ERESTARTSYS; break; And the more natural: if (signal_pending(current)) { ret = -ERESTARTSYS; break; } schedule(); Change them all into the latter form. Reviewed-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20131002092527.956416254@infradead.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r--include/linux/tty.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 64f864651d86..050372979076 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -686,14 +686,13 @@ do { \
686 prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \ 686 prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \
687 if (condition) \ 687 if (condition) \
688 break; \ 688 break; \
689 if (!signal_pending(current)) { \ 689 if (signal_pending(current)) { \
690 tty_unlock(tty); \ 690 ret = -ERESTARTSYS; \
691 schedule(); \ 691 break; \
692 tty_lock(tty); \
693 continue; \
694 } \ 692 } \
695 ret = -ERESTARTSYS; \ 693 tty_unlock(tty); \
696 break; \ 694 schedule(); \
695 tty_lock(tty); \
697 } \ 696 } \
698 finish_wait(&wq, &__wait); \ 697 finish_wait(&wq, &__wait); \
699} while (0) 698} while (0)