diff options
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/macppc/stand/alloc.c | 16 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/sbic.c | 5 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/ssh.c | 5 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/fd.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc64/stand/ofwboot/alloc.c | 16 |
5 files changed, 22 insertions, 24 deletions
diff --git a/sys/arch/macppc/stand/alloc.c b/sys/arch/macppc/stand/alloc.c index 370ba80bba2..94a9cc7af08 100644 --- a/sys/arch/macppc/stand/alloc.c +++ b/sys/arch/macppc/stand/alloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: alloc.c,v 1.4 2005/09/15 20:42:33 kettenis Exp $ */ +/* $OpenBSD: alloc.c,v 1.5 2007/05/28 22:17:21 pyr Exp $ */ /* $NetBSD: alloc.c,v 1.1 1997/04/16 20:29:16 thorpej Exp $ */ /* @@ -114,15 +114,14 @@ alloc(unsigned size) #ifdef ALLOC_FIRST_FIT /* scan freelist */ - for (f = freelist.lh_first; f != NULL && f->size < size; - f = f->list.le_next) - /* noop */ ; + LIST_FOREACH(f, &freelist, list) + if (f->size >= size) + break; bestf = f; failed = (bestf == (struct fl *)0); #else /* scan freelist */ - f = freelist.lh_first; - while (f != NULL) { + LIST_FOREACH(f, &freelist, list) { if (f->size >= size) { if (f->size == size) /* exact match */ goto found; @@ -133,7 +132,6 @@ alloc(unsigned size) bestsize = f->size; } } - f = f->list.le_next; } /* no match in freelist if bestsize unchanged */ @@ -201,13 +199,13 @@ freeall() struct ml *m; /* Release chunks on freelist... */ - while ((m = freelist.lh_first) != NULL) { + while ((m = LIST_FIRST(&freelist)) != NULL) { LIST_REMOVE(m, list); OF_release(m, m->size); } /* ...and allocated list. */ - while ((m = allocatedlist.lh_first) != NULL) { + while ((m = LIST_FIRST(&allocated)) != NULL)) { LIST_REMOVE(m, list); OF_release(m, m->size); } diff --git a/sys/arch/mvme68k/dev/sbic.c b/sys/arch/mvme68k/dev/sbic.c index 177a690d33b..1d96a9f776e 100644 --- a/sys/arch/mvme68k/dev/sbic.c +++ b/sys/arch/mvme68k/dev/sbic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sbic.c,v 1.17 2005/12/03 18:09:37 krw Exp $ */ +/* $OpenBSD: sbic.c,v 1.18 2007/05/28 22:17:21 pyr Exp $ */ /* $NetBSD: sbic.c,v 1.2 1996/04/23 16:32:54 chuck Exp $ */ /* @@ -57,6 +57,7 @@ #include <sys/disklabel.h> #include <sys/dkstat.h> #include <sys/buf.h> +#include <sys/queue.h> #include <scsi/scsi_all.h> #include <scsi/scsiconf.h> #include <uvm/uvm_extern.h> @@ -643,7 +644,7 @@ sbic_scsidone(acb, stat) dosched = 1; /* start next command */ } else - if ( dev->ready_list.tqh_last == &acb->chain.tqe_next ) { + if (TAILQ_LAST(&dev->ready_list) == TAILQ_NEXT(acb, chain)) { TAILQ_REMOVE(&dev->ready_list, acb, chain); diff --git a/sys/arch/mvme68k/dev/ssh.c b/sys/arch/mvme68k/dev/ssh.c index 814f3d150d1..a92aae8a528 100644 --- a/sys/arch/mvme68k/dev/ssh.c +++ b/sys/arch/mvme68k/dev/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.14 2005/12/03 18:09:37 krw Exp $ */ +/* $OpenBSD: ssh.c,v 1.15 2007/05/28 22:17:21 pyr Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -46,6 +46,7 @@ #include <sys/dkstat.h> #include <sys/buf.h> #include <sys/malloc.h> +#include <sys/queue.h> #include <scsi/scsi_all.h> #include <scsi/scsiconf.h> @@ -391,7 +392,7 @@ ssh_scsidone(acb, stat) dosched = 1; /* start next command */ --sc->sc_active; SSH_TRACE('d','a',stat,0) - } else if (sc->ready_list.tqh_last == &acb->chain.tqe_next) { + } else if (TAILQ_LAST(&sc->ready_list) == TAILQ_NEXT(acb, chain)) { TAILQ_REMOVE(&sc->ready_list, acb, chain); SSH_TRACE('d','r',stat,0) } else { diff --git a/sys/arch/sparc64/dev/fd.c b/sys/arch/sparc64/dev/fd.c index f57073d9238..e2c4413ec1e 100644 --- a/sys/arch/sparc64/dev/fd.c +++ b/sys/arch/sparc64/dev/fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fd.c,v 1.10 2007/04/27 22:20:01 krw Exp $ */ +/* $OpenBSD: fd.c,v 1.11 2007/05/28 22:17:21 pyr Exp $ */ /* $NetBSD: fd.c,v 1.112 2003/08/07 16:29:35 agc Exp $ */ /*- @@ -1078,7 +1078,7 @@ fdcstatus(fdc, s) struct fdc_softc *fdc; char *s; { - struct fd_softc *fd = fdc->sc_drives.tqh_first; + struct fd_softc *fd = TAILQ_FIRST(&fdc->sc_drives); int n; /* Just print last status */ diff --git a/sys/arch/sparc64/stand/ofwboot/alloc.c b/sys/arch/sparc64/stand/ofwboot/alloc.c index 7fd70b4e2a0..84852829d83 100644 --- a/sys/arch/sparc64/stand/ofwboot/alloc.c +++ b/sys/arch/sparc64/stand/ofwboot/alloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: alloc.c,v 1.3 2002/03/14 03:16:01 millert Exp $ */ +/* $OpenBSD: alloc.c,v 1.4 2007/05/28 22:17:21 pyr Exp $ */ /* $NetBSD: alloc.c,v 1.1 2000/08/20 14:58:37 mrg Exp $ */ /* @@ -112,15 +112,14 @@ alloc(size) #ifdef ALLOC_FIRST_FIT /* scan freelist */ - for (f = freelist.lh_first; f != NULL && f->size < size; - f = f->list.le_next) - /* noop */ ; + LIST_FOREACH(f, &freelist, list) + if (f->size >= size) + break; bestf = f; failed = (bestf == (struct fl *)0); #else /* scan freelist */ - f = freelist.lh_first; - while (f != NULL) { + LIST_FOREACH(f, &freelist, list) { if (f->size >= size) { if (f->size == size) /* exact match */ goto found; @@ -131,7 +130,6 @@ alloc(size) bestsize = f->size; } } - f = f->list.le_next; } /* no match in freelist if bestsize unchanged */ @@ -201,13 +199,13 @@ freeall() struct ml *m; /* Release chunks on freelist... */ - while ((m = freelist.lh_first) != NULL) { + while ((m = TAILQ_FIRST(&freelist)) != NULL)) { LIST_REMOVE(m, list); OF_release(m, m->size); } /* ...and allocated list. */ - while ((m = allocatedlist.lh_first) != NULL) { + while ((m = TAILQ_FIRST(&allocatedlist)) != NULL)) { LIST_REMOVE(m, list); OF_release(m, m->size); } |