wait: add wait_bit_cleared() helper
[linux-block.git] / kernel / wait.c
index ca0b832d5ff3aa186c12791941ad947d77e2bc96..1c95aa386edc223ffc6a85267d460635bb565e3b 100644 (file)
@@ -178,12 +178,10 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *arg)
        struct wait_bit_queue *wait_bit
                = container_of(wait, struct wait_bit_queue, wait);
 
-       if (wait_bit->key.flags != key->flags ||
-                       wait_bit->key.bit_nr != key->bit_nr ||
-                       test_bit(key->bit_nr, key->flags))
+       if (!wait_bit_cleared(wait_bit, key))
                return 0;
-       else
-               return autoremove_wake_function(wait, mode, sync, key);
+
+       return autoremove_wake_function(wait, mode, sync, key);
 }
 EXPORT_SYMBOL(wake_bit_function);