2004-09-23 20:24:07

by maximilian attems

[permalink] [raw]
Subject: [patch 1/5] use list_for_each() drivers/pcmcia/rsrc_mgr.c



Use list_for_each() where applicable
- for (list = ymf_devs.next; list != &ymf_devs; list = list->next) {
+ list_for_each(list, &ymf_devs) {
pure cosmetic change, defined as a preprocessor macro in:
include/linux/list.h


Signed-off-by: Maximilian Attems <[email protected]>

---

linux-2.6.9-rc2-bk7-max/drivers/pcmcia/rsrc_mgr.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff -puN drivers/pcmcia/rsrc_mgr.c~list_for_each-pcmcia-rsrc_mgr drivers/pcmcia/rsrc_mgr.c
--- linux-2.6.9-rc2-bk7/drivers/pcmcia/rsrc_mgr.c~list_for_each-pcmcia-rsrc_mgr 2004-09-21 20:46:36.000000000 +0200
+++ linux-2.6.9-rc2-bk7-max/drivers/pcmcia/rsrc_mgr.c 2004-09-21 20:46:36.000000000 +0200
@@ -469,7 +469,7 @@ static void validate_mem(struct pcmcia_s
}
if (lo++)
goto out;
- for (m = mem_db.next; m != &mem_db; m = mm.next) {
+ list_for_each(m, &mem_db) {
mm = *m;
/* Only probe < 1 MB */
if (mm.base >= 0x100000) continue;
@@ -501,7 +501,7 @@ static void validate_mem(struct pcmcia_s

if (done++ == 0) {
down(&rsrc_sem);
- for (m = mem_db.next; m != &mem_db; m = mm.next) {
+ list_for_each(m, &mem_db) {
mm = *m;
if (do_mem_probe(mm.base, mm.num, s))
break;
@@ -985,11 +985,11 @@ void release_resource_db(void)
{
resource_map_t *p, *q;

- for (p = mem_db.next; p != &mem_db; p = q) {
+ list_for_each(p, &mem_db) {
q = p->next;
kfree(p);
}
- for (p = io_db.next; p != &io_db; p = q) {
+ list_for_each(p, &io_db) {
q = p->next;
kfree(p);
}
_