summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2010-04-06 01:24:44 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2010-04-06 01:24:44 +0000
commit0d48518eef7942fbb0ae894924978046d795649b (patch)
treeff462676b63efbc82568e03320e65de8adcb701e /sys
parentcb0eca8a4c3249f7ebc058c5ac85c785b09f589f (diff)
use SLISTs for managing the ccb free list rather than TAILQs.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/mpi.c10
-rw-r--r--sys/dev/ic/mpivar.h6
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c
index e3def998d69..7c9ebf16736 100644
--- a/sys/dev/ic/mpi.c
+++ b/sys/dev/ic/mpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpi.c,v 1.137 2010/04/06 01:04:22 dlg Exp $ */
+/* $OpenBSD: mpi.c,v 1.138 2010/04/06 01:24:43 dlg Exp $ */
/*
* Copyright (c) 2005, 2006, 2009 David Gwynne <dlg@openbsd.org>
@@ -954,7 +954,7 @@ mpi_alloc_ccbs(struct mpi_softc *sc)
u_int8_t *cmd;
int i;
- TAILQ_INIT(&sc->sc_ccb_free);
+ SLIST_INIT(&sc->sc_ccb_free);
mtx_init(&sc->sc_ccb_mtx, IPL_BIO);
sc->sc_ccbs = malloc(sizeof(struct mpi_ccb) * sc->sc_maxcmds,
@@ -1025,9 +1025,9 @@ mpi_get_ccb(struct mpi_softc *sc)
struct mpi_ccb *ccb;
mtx_enter(&sc->sc_ccb_mtx);
- ccb = TAILQ_FIRST(&sc->sc_ccb_free);
+ ccb = SLIST_FIRST(&sc->sc_ccb_free);
if (ccb != NULL) {
- TAILQ_REMOVE(&sc->sc_ccb_free, ccb, ccb_link);
+ SLIST_REMOVE_HEAD(&sc->sc_ccb_free, ccb_link);
ccb->ccb_state = MPI_CCB_READY;
}
mtx_leave(&sc->sc_ccb_mtx);
@@ -1052,7 +1052,7 @@ mpi_put_ccb(struct mpi_softc *sc, struct mpi_ccb *ccb)
ccb->ccb_done = NULL;
bzero(ccb->ccb_cmd, MPI_REQUEST_SIZE);
mtx_enter(&sc->sc_ccb_mtx);
- TAILQ_INSERT_TAIL(&sc->sc_ccb_free, ccb, ccb_link);
+ SLIST_INSERT_HEAD(&sc->sc_ccb_free, ccb, ccb_link);
mtx_leave(&sc->sc_ccb_mtx);
}
diff --git a/sys/dev/ic/mpivar.h b/sys/dev/ic/mpivar.h
index 56aa32bb07b..b5e43f0251d 100644
--- a/sys/dev/ic/mpivar.h
+++ b/sys/dev/ic/mpivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpivar.h,v 1.30 2010/04/06 01:04:24 dlg Exp $ */
+/* $OpenBSD: mpivar.h,v 1.31 2010/04/06 01:24:43 dlg Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
@@ -92,10 +92,10 @@ struct mpi_ccb {
void (*ccb_done)(struct mpi_ccb *);
struct mpi_rcb *ccb_rcb;
- TAILQ_ENTRY(mpi_ccb) ccb_link;
+ SLIST_ENTRY(mpi_ccb) ccb_link;
};
-TAILQ_HEAD(mpi_ccb_list, mpi_ccb);
+SLIST_HEAD(mpi_ccb_list, mpi_ccb);
struct mpi_softc {
struct device sc_dev;