summaryrefslogtreecommitdiff
path: root/kernel/semaphore.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2008-08-06 00:01:13 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-08-06 01:33:47 +0400
commit5b2becc8cffdccdd60c63099f592ddd35aa6c34f (patch)
treee502280aee4d93b059a93526ba3f02a6883a596d /kernel/semaphore.c
parent32194450330be327f3b25bf6b66298bd122599e9 (diff)
downloadlinux-5b2becc8cffdccdd60c63099f592ddd35aa6c34f.tar.xz
semaphore: __down_common: use signal_pending_state()
Change __down_common() to use signal_pending_state() instead of open coding. The changes in kernel/semaphore.o are just artifacts, the state checks are optimized away. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: Ingo Molnar <mingo@elte.hu> Cc: Matthew Wilcox <matthew@wil.cx> Cc: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/semaphore.c')
-rw-r--r--kernel/semaphore.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/semaphore.c b/kernel/semaphore.c
index aaaeae8244e7..94a62c0d4ade 100644
--- a/kernel/semaphore.c
+++ b/kernel/semaphore.c
@@ -212,9 +212,7 @@ static inline int __sched __down_common(struct semaphore *sem, long state,
waiter.up = 0;
for (;;) {
- if (state == TASK_INTERRUPTIBLE && signal_pending(task))
- goto interrupted;
- if (state == TASK_KILLABLE && fatal_signal_pending(task))
+ if (signal_pending_state(state, task))
goto interrupted;
if (timeout <= 0)
goto timed_out;