summaryrefslogtreecommitdiff
path: root/sys/arch/macppc/dev
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-12-25 23:02:27 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-12-25 23:02:27 +0000
commitf817c58ea799274eb832d25dc61acb5955f9b2d9 (patch)
treed81a72a842cf99a20e3b22543a17b8e53ad25961 /sys/arch/macppc/dev
parentf1b1a2a9897fb5e4903d7922e7d05f99ad07b847 (diff)
Use list and queue macros where applicable to make the code easier to read;
no functional change.
Diffstat (limited to 'sys/arch/macppc/dev')
-rw-r--r--sys/arch/macppc/dev/mesh.c30
-rw-r--r--sys/arch/macppc/dev/snapper.c4
2 files changed, 14 insertions, 20 deletions
diff --git a/sys/arch/macppc/dev/mesh.c b/sys/arch/macppc/dev/mesh.c
index 748e13e83ea..9406e926532 100644
--- a/sys/arch/macppc/dev/mesh.c
+++ b/sys/arch/macppc/dev/mesh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mesh.c,v 1.8 2004/01/09 22:57:09 jmc Exp $ */
+/* $OpenBSD: mesh.c,v 1.9 2004/12/25 23:02:24 miod Exp $ */
/* $NetBSD: mesh.c,v 1.1 1999/02/19 13:06:03 tsubai Exp $ */
/*-
@@ -909,7 +909,7 @@ mesh_get_scb(sc)
int s;
s = splbio();
- while ((scb = sc->free_scb.tqh_first) == NULL)
+ while ((scb = TAILQ_FIRST(&sc->free_scb)) == NULL)
tsleep(&sc->free_scb, PRIBIO, "meshscb", 0);
TAILQ_REMOVE(&sc->free_scb, scb, chain);
splx(s);
@@ -926,7 +926,7 @@ mesh_free_scb(sc, scb)
s = splbio();
TAILQ_INSERT_HEAD(&sc->free_scb, scb, chain);
- if (scb->chain.tqe_next == NULL)
+ if (TAILQ_NEXT(&scb->chain) == NULL)
wakeup(&sc->free_scb);
splx(s);
}
@@ -1005,23 +1005,17 @@ mesh_sched(sc)
struct scsi_link *sc_link;
struct mesh_scb *scb;
- scb = sc->ready_scb.tqh_first;
-start:
- if (scb == NULL)
- return;
-
- xs = scb->xs;
- sc_link = xs->sc_link;
+ TAILQ_FOREACH(scb, &sc->ready_scb, chain) {
+ xs = scb->xs;
+ sc_link = xs->sc_link;
- if (sc->sc_nexus == NULL) {
- TAILQ_REMOVE(&sc->ready_scb, scb, chain);
- sc->sc_nexus = scb;
- mesh_select(sc, scb);
- return;
+ if (sc->sc_nexus == NULL) {
+ TAILQ_REMOVE(&sc->ready_scb, scb, chain);
+ sc->sc_nexus = scb;
+ mesh_select(sc, scb);
+ return;
+ }
}
-
- scb = scb->chain.tqe_next;
- goto start;
}
int
diff --git a/sys/arch/macppc/dev/snapper.c b/sys/arch/macppc/dev/snapper.c
index 1753dd1d942..0f0ec11312f 100644
--- a/sys/arch/macppc/dev/snapper.c
+++ b/sys/arch/macppc/dev/snapper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: snapper.c,v 1.6 2004/12/25 19:01:01 miod Exp $ */
+/* $OpenBSD: snapper.c,v 1.7 2004/12/25 23:02:24 miod Exp $ */
/* $NetBSD: snapper.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */
/*-
@@ -383,7 +383,7 @@ snapper_defer(struct device *dev)
struct snapper_softc *sc = (struct snapper_softc *)dev;
struct device *dv;
- for (dv = alldevs.tqh_first; dv; dv=dv->dv_list.tqe_next)
+ TAILQ_FOREACH(dv, &alldevs, dv_list)
if (strncmp(dv->dv_xname, "ki2c", 4) == 0 &&
strncmp(dv->dv_parent->dv_xname, "macobio", 7) == 0)
sc->sc_i2c = dv;