]> git.hungrycats.org Git - linux/commitdiff
[PATCH] futex: remove redundant test
authorAndrew Morton <akpm@osdl.org>
Wed, 4 Feb 2004 02:45:51 +0000 (18:45 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Wed, 4 Feb 2004 02:45:51 +0000 (18:45 -0800)
From: Jamie Lokier <jamie@shareable.org>

One of the tests in unqueue_me() is redundant.  If we acquire the spinlock,
the futex must be queued.

kernel/futex.c

index 7194b3cf726a8685be3bad650cb3cce480c2f040..93f7ea6f80be4f3876dcf43994e450d0200ceb83 100644 (file)
@@ -430,11 +430,10 @@ static int unqueue_me(struct futex_q *q)
                        spin_unlock(lock_ptr);
                        goto retry;
                }
-               if (likely(!list_empty(&q->list))) {
-                       list_del(&q->list);
-                       ret = 1;
-               }
+               WARN_ON(list_empty(&q->list));
+               list_del(&q->list);
                spin_unlock(lock_ptr);
+               ret = 1;
        }
 
        drop_key_refs(&q->key);