From: liguang Date: Tue, 30 Apr 2013 22:28:32 +0000 (-0700) Subject: semaphore: use unlikely() for down's timeout X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c74f66ce102e2cfb61c185f7451538e29de640b9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git semaphore: use unlikely() for down's timeout Signed-off-by: liguang Cc: Jiri Kosina Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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, for (;;) { if (signal_pending_state(state, task)) goto interrupted; - if (timeout <= 0) + if (unlikely(timeout <= 0)) goto timed_out; __set_task_state(task, state); raw_spin_unlock_irq(&sem->lock);