sched/wait: Make the signal_pending() checks consistent
authorPeter Zijlstra <peterz@infradead.org>
Wed, 2 Oct 2013 09:22:18 +0000 (11:22 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 4 Oct 2013 08:14:44 +0000 (10:14 +0200)
commit2f2a2b60adf368bacd6acd2116c01e32caf936c4
treeec7b7bac11365f1d0ae1a2d258429e265f27445d
parent75f93fed50c2abadbab6ef546b265f51ca975b27
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>
include/linux/tty.h
include/linux/wait.h