Use more TAILQ macro. From OpenBSD.

This commit is contained in:
tsutsui 2007-06-30 19:24:30 +00:00
parent b013a2d4f9
commit 25f9eea68b
1 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: osiop.c,v 1.30 2007/06/30 14:56:48 tsutsui Exp $ */
/* $NetBSD: osiop.c,v 1.31 2007/06/30 19:24:30 tsutsui Exp $ */
/*
* Copyright (c) 2001 Izumi Tsutsui. All rights reserved.
@ -100,7 +100,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: osiop.c,v 1.30 2007/06/30 14:56:48 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: osiop.c,v 1.31 2007/06/30 19:24:30 tsutsui Exp $");
/* #define OSIOP_DEBUG */
@ -544,8 +544,8 @@ osiop_sched(struct osiop_softc *sc)
printf("%s: osiop_sched- nexus %p/%d ready %p/%d\n",
sc->sc_dev.dv_xname, sc->sc_nexus,
sc->sc_nexus->xs->xs_periph->periph_target,
sc->ready_list.tqh_first,
sc->ready_list.tqh_first->xs->xs_periph->periph_target);
TAILQ_FIRST(&sc->ready_list),
TAILQ_FIRST(&sc->ready_list)->xs->xs_periph->periph_target);
return;
}
#endif
@ -660,7 +660,7 @@ osiop_scsidone(struct osiop_acb *acb, int status)
dosched = 1; /* start next command */
sc->sc_active--;
OSIOP_TRACE('d', 'a', status, 0);
} else if (sc->ready_list.tqh_last == &acb->chain.tqe_next) {
} else if (sc->ready_list.tqh_last == &TAILQ_NEXT(acb, chain)) {
TAILQ_REMOVE(&sc->ready_list, acb, chain);
OSIOP_TRACE('d', 'r', status, 0);
} else {
@ -675,7 +675,7 @@ osiop_scsidone(struct osiop_acb *acb, int status)
}
}
if (acb2 == NULL) {
if (acb->chain.tqe_next != NULL) {
if (TAILQ_NEXT(acb, chain) != NULL) {
TAILQ_REMOVE(&sc->ready_list, acb, chain);
sc->sc_active--;
} else {