diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-12-25 23:02:27 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-12-25 23:02:27 +0000 |
commit | f817c58ea799274eb832d25dc61acb5955f9b2d9 (patch) | |
tree | d81a72a842cf99a20e3b22543a17b8e53ad25961 /sys/arch/sparc64 | |
parent | f1b1a2a9897fb5e4903d7922e7d05f99ad07b847 (diff) |
Use list and queue macros where applicable to make the code easier to read;
no functional change.
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r-- | sys/arch/sparc64/dev/iommu.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/autoconf.c | 11 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/db_interface.c | 8 |
3 files changed, 11 insertions, 12 deletions
diff --git a/sys/arch/sparc64/dev/iommu.c b/sys/arch/sparc64/dev/iommu.c index bca2e3994f2..5caf6e2439c 100644 --- a/sys/arch/sparc64/dev/iommu.c +++ b/sys/arch/sparc64/dev/iommu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iommu.c,v 1.35 2004/03/19 21:04:00 miod Exp $ */ +/* $OpenBSD: iommu.c,v 1.36 2004/12/25 23:02:25 miod Exp $ */ /* $NetBSD: iommu.c,v 1.47 2002/02/08 20:03:45 eeh Exp $ */ /* @@ -1644,7 +1644,7 @@ iommu_dvmamem_map(bus_dma_tag_t t, bus_dma_tag_t t0, bus_dma_segment_t *segs, * Now take this and map it into the CPU. */ mlist = segs[0]._ds_mlist; - for (m = mlist->tqh_first; m != NULL; m = m->pageq.tqe_next) { + TAILQ_FOREACH(m, mlist, pageq) { #ifdef DIAGNOSTIC if (size == 0) panic("iommu_dvmamem_map: size botch"); diff --git a/sys/arch/sparc64/sparc64/autoconf.c b/sys/arch/sparc64/sparc64/autoconf.c index 10d98b86eaf..1bbed64ee62 100644 --- a/sys/arch/sparc64/sparc64/autoconf.c +++ b/sys/arch/sparc64/sparc64/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.36 2004/10/23 08:21:27 mjc Exp $ */ +/* $OpenBSD: autoconf.c,v 1.37 2004/12/25 23:02:25 miod Exp $ */ /* $NetBSD: autoconf.c,v 1.51 2001/07/24 19:32:11 eeh Exp $ */ /* @@ -786,8 +786,7 @@ getdisk(str, len, defpart, devp) #ifdef RAMDISK_HOOKS printf(" %s[a-p]", fakerdrootdev.dv_xname); #endif - for (dv = alldevs.tqh_first; dv != NULL; - dv = dv->dv_list.tqe_next) { + TAILQ_FOREACH(dv, &alldevs, dv_list) { if (dv->dv_class == DV_DISK) printf(" %s[a-p]", dv->dv_xname); #ifdef NFSCLIENT @@ -827,7 +826,7 @@ parsedisk(str, len, defpart, devp) } #endif - for (dv = alldevs.tqh_first; dv != NULL; dv = dv->dv_list.tqe_next) { + TAILQ_FOREACH(dv, &alldevs, dv_list) { if (dv->dv_class == DV_DISK && strcmp(str, dv->dv_xname) == 0) { #ifdef RAMDISK_HOOKS @@ -1336,7 +1335,7 @@ getdevunit(name, unit) char *name; int unit; { - struct device *dev = alldevs.tqh_first; + struct device *dev = TAILQ_FIRST(&alldevs); char num[10], fullname[16]; int lunit; @@ -1350,7 +1349,7 @@ getdevunit(name, unit) strlcat(fullname, num, sizeof fullname); while (strcmp(dev->dv_xname, fullname) != 0) { - if ((dev = dev->dv_list.tqe_next) == NULL) + if ((dev = TAILQ_NEXT(dev, dv_list)) == NULL) return NULL; } return dev; diff --git a/sys/arch/sparc64/sparc64/db_interface.c b/sys/arch/sparc64/sparc64/db_interface.c index c2727adbce5..bc30cf1f2d9 100644 --- a/sys/arch/sparc64/sparc64/db_interface.c +++ b/sys/arch/sparc64/sparc64/db_interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_interface.c,v 1.18 2003/12/20 20:08:17 miod Exp $ */ +/* $OpenBSD: db_interface.c,v 1.19 2004/12/25 23:02:25 miod Exp $ */ /* $NetBSD: db_interface.c,v 1.61 2001/07/31 06:55:47 eeh Exp $ */ /* @@ -832,7 +832,7 @@ db_ctx_cmd(addr, have_addr, count, modif) struct proc *p; /* XXX LOCKING XXX */ - for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) { + LIST_FOREACH(p, &allproc, p_list) { if (p->p_stat) { db_printf("process %p:", p); db_printf("pid:%d pmap:%p ctx:%x tf:%p fpstate %p " @@ -910,7 +910,7 @@ db_setpcb(addr, have_addr, count, modif) return; } - for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) { + LIST_FOREACH(p, &allproc, p_list) { pp = p->p_pptr; if (p->p_stat && p->p_pid == addr) { curproc = p; @@ -1062,7 +1062,7 @@ db_uvmhistdump(addr, have_addr, count, modif) char *modif; { - uvmhist_dump(uvm_histories.lh_first); + uvmhist_dump(LIST_FIRST(&uvm_histories)); } #endif |