From: Oleg Nesterov Date: Tue, 5 Aug 2008 20:01:13 +0000 (-0700) Subject: semaphore: __down_common: use signal_pending_state() X-Git-Tag: v2.6.27-rc2~29 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=5b2becc8cffdccdd60c63099f592ddd35aa6c34f;p=linux-2.6-omap-h63xx.git 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 Cc: Ingo Molnar Cc: Matthew Wilcox Cc: Roland McGrath Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/semaphore.c b/kernel/semaphore.c index aaaeae8244e..94a62c0d4ad 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;