]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
semaphore: use unlikely() for down's timeout
authorliguang <lig.fnst@cn.fujitsu.com>
Sat, 23 Mar 2013 02:33:05 +0000 (13:33 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 26 Mar 2013 05:11:43 +0000 (16:11 +1100)
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/semaphore.c

index 4567fc020fe343970e0cb09c53aed567531be703..9c7017d1d99695b7767b2471843f6e63c7fa0e75 100644 (file)
@@ -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);