From: domen@coderock•org
To: benh@kernel•crashing.org
Cc: linuxppc-dev@ozlabs•org, domen@coderock•org
Subject: [patch 1/1] Re: list_for_each_entry: drivers-macintosh-via-pmu.c]
Date: Sat, 19 Mar 2005 14:19:19 +0100 [thread overview]
Message-ID: <20050319131920.099BF1F23D@trashy.coderock.org> (raw)
Replace for loops with nice list_for_each* macros.
Signed-off-by: Domen Puncer <domen@coderock•org>
---
kj-domen/drivers/macintosh/via-pmu.c | 16 ++++------------
1 files changed, 4 insertions(+), 12 deletions(-)
diff -puN drivers/macintosh/via-pmu.c~list_for_each-drivers_macintosh_via-pmu drivers/macintosh/via-pmu.c
--- kj/drivers/macintosh/via-pmu.c~list_for_each-drivers_macintosh_via-pmu 2005-03-18 20:05:49.000000000 +0100
+++ kj-domen/drivers/macintosh/via-pmu.c 2005-03-18 20:05:49.000000000 +0100
@@ -2062,8 +2062,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;
@@ -2090,8 +2089,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) {
@@ -2112,14 +2110,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;
}
@@ -2720,15 +2714,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)
_
reply other threads:[~2005-03-19 13:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050319131920.099BF1F23D@trashy.coderock.org \
--to=domen@coderock$(echo .)org \
--cc=benh@kernel$(echo .)crashing.org \
--cc=linuxppc-dev@ozlabs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox