summaryrefslogtreecommitdiff
path: root/sys/arch/alpha
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/alpha
parentf1b1a2a9897fb5e4903d7922e7d05f99ad07b847 (diff)
Use list and queue macros where applicable to make the code easier to read;
no functional change.
Diffstat (limited to 'sys/arch/alpha')
-rw-r--r--sys/arch/alpha/alpha/autoconf.c7
-rw-r--r--sys/arch/alpha/dev/bus_dma.c8
-rw-r--r--sys/arch/alpha/dev/shared_intr.c11
3 files changed, 11 insertions, 15 deletions
diff --git a/sys/arch/alpha/alpha/autoconf.c b/sys/arch/alpha/alpha/autoconf.c
index 8e5ec66fb15..bcc44dcd3f7 100644
--- a/sys/arch/alpha/alpha/autoconf.c
+++ b/sys/arch/alpha/alpha/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.23 2004/07/18 02:29:11 deraadt Exp $ */
+/* $OpenBSD: autoconf.c,v 1.24 2004/12/25 23:02:21 miod Exp $ */
/* $NetBSD: autoconf.c,v 1.16 1996/11/13 21:13:04 cgd Exp $ */
/*
@@ -203,8 +203,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
@@ -247,7 +246,7 @@ parsedisk(str, len, defpart, devp)
goto gotdisk;
}
#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
diff --git a/sys/arch/alpha/dev/bus_dma.c b/sys/arch/alpha/dev/bus_dma.c
index f915392f560..e29526e7afb 100644
--- a/sys/arch/alpha/dev/bus_dma.c
+++ b/sys/arch/alpha/dev/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.13 2004/11/09 19:17:00 claudio Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.14 2004/12/25 23:02:23 miod Exp $ */
/* $NetBSD: bus_dma.c,v 1.40 2000/07/17 04:47:56 thorpej Exp $ */
/*-
@@ -501,13 +501,13 @@ _bus_dmamem_alloc_range(t, size, alignment, boundary, segs, nsegs, rsegs,
* Compute the location, size, and number of segments actually
* returned by the VM code.
*/
- m = mlist.tqh_first;
+ m = TAILQ_FIRST(&mlist);
curseg = 0;
lastaddr = segs[curseg].ds_addr = VM_PAGE_TO_PHYS(m);
segs[curseg].ds_len = PAGE_SIZE;
- m = m->pageq.tqe_next;
+ m = TAILQ_NEXT(m, pageq);
- for (; m != NULL; m = m->pageq.tqe_next) {
+ for (; m != TAILQ_END(&mlist); m = TAILQ_NEXT(m, pageq)) {
curaddr = VM_PAGE_TO_PHYS(m);
#ifdef DIAGNOSTIC
if (curaddr < avail_start || curaddr >= high) {
diff --git a/sys/arch/alpha/dev/shared_intr.c b/sys/arch/alpha/dev/shared_intr.c
index 31f78bb877c..626231f45ab 100644
--- a/sys/arch/alpha/dev/shared_intr.c
+++ b/sys/arch/alpha/dev/shared_intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: shared_intr.c,v 1.12 2004/06/28 02:28:42 aaron Exp $ */
+/* $OpenBSD: shared_intr.c,v 1.13 2004/12/25 23:02:23 miod Exp $ */
/* $NetBSD: shared_intr.c,v 1.13 2000/03/19 01:46:18 thorpej Exp $ */
/*
@@ -95,10 +95,8 @@ alpha_shared_intr_dispatch(intr, num)
struct alpha_shared_intrhand *ih;
int rv, handled;
- ih = intr[num].intr_q.tqh_first;
handled = 0;
- while (ih != NULL) {
-
+ TAILQ_FOREACH(ih, &intr[num].intr_q, ih_q) {
/*
* The handler returns one of three values:
* 0: This interrupt wasn't for me.
@@ -110,7 +108,6 @@ alpha_shared_intr_dispatch(intr, num)
ih->ih_count.ec_count++;
handled = handled || (rv != 0);
- ih = ih->ih_q.tqe_next;
}
return (handled);
@@ -150,7 +147,7 @@ alpha_shared_intr_establish(intr, num, type, level, fn, arg, basename)
break;
case IST_PULSE:
if (type != IST_NONE) {
- if (intr[num].intr_q.tqh_first == NULL) {
+ if (TAILQ_EMPTY(&intr[num].intr_q)) {
printf("alpha_shared_intr_establish: %s %d: warning: using %s on %s\n",
basename, num, intr_typename(type),
intr_typename(intr[num].intr_sharetype));
@@ -215,7 +212,7 @@ alpha_shared_intr_isactive(intr, num)
unsigned int num;
{
- return (intr[num].intr_q.tqh_first != NULL);
+ return (!TAILQ_EMPTY(&intr[num].intr_q));
}
void