[PATCH] drivers/macintosh/via-pmu.c: use list_for_each*() From: Domen Puncer Replace for() loops with nice list_for_each*() macros. Signed-off-by: Domen Puncer Signed-off-by: Alexey Dobriyan Index: linux-kj/drivers/macintosh/via-pmu.c =================================================================== --- linux-kj.orig/drivers/macintosh/via-pmu.c 2005-10-11 18:36:44.000000000 +0400 +++ linux-kj/drivers/macintosh/via-pmu.c 2005-10-11 18:37:26.000000000 +0400 @@ -2055,8 +2055,7 @@ pmu_register_sleep_notifier(struct pmu_s struct list_head *list; struct pmu_sleep_notifier *notifier; - for (list = sleep_notifiers.next; list != &sleep_notifiers; - list = list->next) { + list_for_each(list, &sleep_notifiers) { notifier = list_entry(list, struct pmu_sleep_notifier, list); if (n->priority > notifier->priority) break; @@ -2083,8 +2082,7 @@ broadcast_sleep(int when, int fallback) struct list_head *list; struct pmu_sleep_notifier *notifier; - for (list = sleep_notifiers.prev; list != &sleep_notifiers; - list = list->prev) { + list_for_each_prev(list, &sleep_notifiers) { notifier = list_entry(list, struct pmu_sleep_notifier, list); ret = notifier->notifier_call(notifier, when); if (ret != PBOOK_SLEEP_OK) { @@ -2105,14 +2103,10 @@ static int __pmac broadcast_wake(void) { int ret = PBOOK_SLEEP_OK; - struct list_head *list; struct pmu_sleep_notifier *notifier; - for (list = sleep_notifiers.next; list != &sleep_notifiers; - list = list->next) { - notifier = list_entry(list, struct pmu_sleep_notifier, list); + list_for_each_entry(notifier, &sleep_notifiers, list) notifier->notifier_call(notifier, PBOOK_WAKE); - } return ret; } @@ -2726,15 +2720,13 @@ static void __pmac pmu_pass_intr(unsigned char *data, int len) { struct pmu_private *pp; - struct list_head *list; int i; unsigned long flags; if (len > sizeof(pp->rb_buf[0].data)) len = sizeof(pp->rb_buf[0].data); spin_lock_irqsave(&all_pvt_lock, flags); - for (list = &all_pmu_pvt; (list = list->next) != &all_pmu_pvt; ) { - pp = list_entry(list, struct pmu_private, list); + list_for_each_entry(pp, &all_pmu_pvt, list) { spin_lock(&pp->lock); i = pp->rb_put + 1; if (i >= RB_SIZE)