diff options
author | 2006-03-05 21:48:54 +0000 | |
---|---|---|
committer | 2006-03-05 21:48:54 +0000 | |
commit | 1573508e4a2b79545b4e249a73d6b17aac49719c (patch) | |
tree | 71ace380f161b052a5a1ed8e427236a217c5ad15 /sys/dev | |
parent | Sprinkle some tabs and a little cleaning. (diff) | |
download | wireguard-openbsd-1573508e4a2b79545b4e249a73d6b17aac49719c.tar.xz wireguard-openbsd-1573508e4a2b79545b4e249a73d6b17aac49719c.zip |
Use more queue macros rather than doing it by hand; ok otto@ krw@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/ncr53c9x.c | 19 | ||||
-rw-r--r-- | sys/dev/isa/if_trtcm_isa.c | 5 | ||||
-rw-r--r-- | sys/dev/raidframe/rf_openbsdkintf.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/esp_sbus.c | 6 |
4 files changed, 16 insertions, 18 deletions
diff --git a/sys/dev/ic/ncr53c9x.c b/sys/dev/ic/ncr53c9x.c index 4d0d5f3d921..149ea6acbc8 100644 --- a/sys/dev/ic/ncr53c9x.c +++ b/sys/dev/ic/ncr53c9x.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ncr53c9x.c,v 1.29 2006/01/09 23:11:49 miod Exp $ */ +/* $OpenBSD: ncr53c9x.c,v 1.30 2006/03/05 21:48:56 miod Exp $ */ /* $NetBSD: ncr53c9x.c,v 1.56 2000/11/30 14:41:46 thorpej Exp $ */ /* @@ -906,7 +906,7 @@ ncr53c9x_sched(sc) * Find first ecb in ready queue that is for a target/lunit * combinations that is not busy. */ - for (ecb = sc->ready_list.tqh_first; ecb; ecb = ecb->chain.tqe_next) { + TAILQ_FOREACH(ecb, &sc->ready_list, chain) { sc_link = ecb->xs->sc_link; ti = &sc->sc_tinfo[sc_link->target]; lun = sc_link->lun; @@ -2142,18 +2142,18 @@ again: /* Selection timeout -- discard all LUNs if empty */ sc_link = ecb->xs->sc_link; ti = &sc->sc_tinfo[sc_link->target]; - li = ti->luns.lh_first; - while (li) { + for (li = LIST_FIRST(&ti->luns); + li != LIST_END(&ti->luns); ) { if (!li->untagged && !li->used) { if (li->lun < NCR_NLUN) ti->lun[li->lun] = NULL; LIST_REMOVE(li, link); free(li, M_DEVBUF); /* Restart the search at the beginning */ - li = ti->luns.lh_first; + li = LIST_FIRST(&ti->luns); continue; } - li = li->link.le_next; + li = LIST_NEXT(li, link); } goto finish; } @@ -2805,18 +2805,17 @@ ncr53c9x_watch(arg) s = splbio(); for (t=0; t<NCR_NTARG; t++) { ti = &sc->sc_tinfo[t]; - li = ti->luns.lh_first; - while (li) { + for (li = LIST_FIRST(&ti->luns); li != LIST_END(&ti->luns); ) { if (li->last_used < old && !li->untagged && !li->used) { if (li->lun < NCR_NLUN) ti->lun[li->lun] = NULL; LIST_REMOVE(li, link); free(li, M_DEVBUF); /* Restart the search at the beginning */ - li = ti->luns.lh_first; + li = LIST_FIRST(&ti->luns); continue; } - li = li->link.le_next; + li = LIST_NEXT(li, link); } } splx(s); diff --git a/sys/dev/isa/if_trtcm_isa.c b/sys/dev/isa/if_trtcm_isa.c index 98bf3ea64bc..7dcd8c20f4a 100644 --- a/sys/dev/isa/if_trtcm_isa.c +++ b/sys/dev/isa/if_trtcm_isa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_trtcm_isa.c,v 1.3 2002/03/14 01:26:56 millert Exp $ */ +/* $OpenBSD: if_trtcm_isa.c,v 1.4 2006/03/05 21:48:56 miod Exp $ */ /* $NetBSD: if_trtcm_isa.c,v 1.3 1999/04/30 15:29:24 bad Exp $ */ #undef TRTCMISADEBUG @@ -227,8 +227,7 @@ trtcm_isa_probe(parent, match, aux) /* * Probe this bus if we haven't done so already. */ - for (tcm = tcm_isa_all_probes.lh_first; tcm != NULL; - tcm = tcm->tcm_link.le_next) + LIST_FOREACH(tcm, &tcm_isa_all_probes, tcm_link) if (tcm->tcm_bus == bus) goto bus_probed; diff --git a/sys/dev/raidframe/rf_openbsdkintf.c b/sys/dev/raidframe/rf_openbsdkintf.c index b0393ca867a..30301ffc157 100644 --- a/sys/dev/raidframe/rf_openbsdkintf.c +++ b/sys/dev/raidframe/rf_openbsdkintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rf_openbsdkintf.c,v 1.32 2006/01/21 12:20:51 miod Exp $ */ +/* $OpenBSD: rf_openbsdkintf.c,v 1.33 2006/03/05 21:48:56 miod Exp $ */ /* $NetBSD: rf_netbsdkintf.c,v 1.109 2001/07/27 03:30:07 oster Exp $ */ /*- @@ -2753,7 +2753,7 @@ rf_find_raid_components(void) #ifdef RAID_AUTOCONFIG /* We begin by trolling through *all* the devices on the system. */ - for (dv = alldevs.tqh_first; dv != NULL; dv = dv->dv_list.tqe_next) { + TAILQ_FOREACH(dv, &alldevs, dv_list) { /* We are only interested in disks... */ if (dv->dv_class != DV_DISK) diff --git a/sys/dev/sbus/esp_sbus.c b/sys/dev/sbus/esp_sbus.c index 82c0e035c9b..6ba67c2cc9d 100644 --- a/sys/dev/sbus/esp_sbus.c +++ b/sys/dev/sbus/esp_sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: esp_sbus.c,v 1.16 2004/09/29 19:17:43 miod Exp $ */ +/* $OpenBSD: esp_sbus.c,v 1.17 2006/03/05 21:48:56 miod Exp $ */ /* $NetBSD: esp_sbus.c,v 1.14 2001/04/25 17:53:37 bouyer Exp $ */ /*- @@ -721,9 +721,9 @@ db_esp(db_expr_t addr, int have_addr, db_expr_t count, char *modif) sc->sc_imess[1], sc->sc_imess[2], sc->sc_imess[3], sc->sc_imess[0]); db_printf("ready: "); - for (ecb = sc->ready_list.tqh_first; ecb; ecb = ecb->chain.tqe_next) { + TAILQ_FOREACH(ecb, &sc->ready_list, chain) { db_printf("ecb %p ", ecb); - if (ecb == ecb->chain.tqe_next) { + if (ecb == TAILQ_NEXT(ecb, chain)) { db_printf("\nWARNING: tailq loop on ecb %p", ecb); break; } |