diff options
author | liguang <lig.fnst@cn.fujitsu.com> | 2013-04-30 18:28:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-30 20:04:08 -0400 |
commit | c74f66ce102e2cfb61c185f7451538e29de640b9 (patch) | |
tree | 20ad92052a52f5cc080633d5a2e6a2e400d2f010 /kernel/semaphore.c | |
parent | 97439d0f84942d3031545e80852dde09457136c6 (diff) |
semaphore: use unlikely() for down's timeout
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
Cc: Jiri Kosina <jkosina@suse.cz>
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/semaphore.c b/kernel/semaphore.c index 4567fc020fe3..9c7017d1d996 100644 --- a/kernel/semaphore.c +++ b/kernel/semaphore.c | |||
@@ -214,7 +214,7 @@ static inline int __sched __down_common(struct semaphore *sem, long state, | |||
214 | for (;;) { | 214 | for (;;) { |
215 | if (signal_pending_state(state, task)) | 215 | if (signal_pending_state(state, task)) |
216 | goto interrupted; | 216 | goto interrupted; |
217 | if (timeout <= 0) | 217 | if (unlikely(timeout <= 0)) |
218 | goto timed_out; | 218 | goto timed_out; |
219 | __set_task_state(task, state); | 219 | __set_task_state(task, state); |
220 | raw_spin_unlock_irq(&sem->lock); | 220 | raw_spin_unlock_irq(&sem->lock); |