Skip to content

Commit

Permalink
sched: use list_for_each_entry_safe() in __wake_up_common()
Browse files Browse the repository at this point in the history
Use list_for_each_entry_safe() instead of list_for_each_safe() in
__wake_up_common()

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Matthias Kaehlcke authored and Ingo Molnar committed Oct 15, 2007
1 parent bb61c21 commit 2e45874
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -3634,10 +3634,9 @@ EXPORT_SYMBOL(default_wake_function);
static void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
int nr_exclusive, int sync, void *key)
{
struct list_head *tmp, *next;
wait_queue_t *curr, *next;

list_for_each_safe(tmp, next, &q->task_list) {
wait_queue_t *curr = list_entry(tmp, wait_queue_t, task_list);
list_for_each_entry_safe(curr, next, &q->task_list, task_list) {
unsigned flags = curr->flags;

if (curr->func(curr, mode, sync, key) &&
Expand Down

0 comments on commit 2e45874

Please sign in to comment.