summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/dev/bus_dma.c4
-rw-r--r--sys/arch/arm/arm/bus_dma.c4
-rw-r--r--sys/arch/aviion/aviion/bus_dma.c4
-rw-r--r--sys/arch/loongson/loongson/bus_dma.c4
-rw-r--r--sys/arch/octeon/octeon/bus_dma.c4
-rw-r--r--sys/arch/sgi/sgi/bus_dma.c4
-rw-r--r--sys/arch/vax/vax/bus_dma.c4
-rw-r--r--sys/dev/ic/if_wi_hostap.c9
-rw-r--r--sys/dev/ic/qla.c4
-rw-r--r--sys/dev/pci/drm/drm_drv.c5
-rw-r--r--sys/dev/pci/drm/drm_irq.c6
-rw-r--r--sys/dev/pci/maestro.c6
-rw-r--r--sys/dev/pci/pci.c5
-rw-r--r--sys/dev/pci/qle.c4
-rw-r--r--sys/dev/softraid.c23
-rw-r--r--sys/dev/softraid_crypto.c4
-rw-r--r--sys/kern/spec_vnops.c5
-rw-r--r--sys/kern/subr_extent.c7
-rw-r--r--sys/kern/sysv_sem.c6
-rw-r--r--sys/kern/vfs_cache.c8
-rw-r--r--sys/kern/vfs_subr.c5
-rw-r--r--sys/scsi/ses.c4
22 files changed, 60 insertions, 69 deletions
diff --git a/sys/arch/alpha/dev/bus_dma.c b/sys/arch/alpha/dev/bus_dma.c
index 0c9d0c0ff08..08e55b2831b 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.33 2014/07/12 18:44:40 tedu Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.34 2014/09/13 16:06:36 doug Exp $ */
/* $NetBSD: bus_dma.c,v 1.40 2000/07/17 04:47:56 thorpej Exp $ */
/*-
@@ -511,7 +511,7 @@ _bus_dmamem_alloc_range(t, size, alignment, boundary, segs, nsegs, rsegs,
segs[curseg].ds_len = PAGE_SIZE;
m = TAILQ_NEXT(m, pageq);
- for (; m != TAILQ_END(&mlist); m = TAILQ_NEXT(m, pageq)) {
+ for (; m != NULL; m = TAILQ_NEXT(m, pageq)) {
curaddr = VM_PAGE_TO_PHYS(m);
#ifdef DIAGNOSTIC
if (curaddr < low || curaddr >= high) {
diff --git a/sys/arch/arm/arm/bus_dma.c b/sys/arch/arm/arm/bus_dma.c
index 164dbc642d7..5e27c0ac5ba 100644
--- a/sys/arch/arm/arm/bus_dma.c
+++ b/sys/arch/arm/arm/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.26 2014/07/12 18:44:41 tedu Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.27 2014/09/13 16:06:36 doug Exp $ */
/* $NetBSD: bus_dma.c,v 1.38 2003/10/30 08:44:13 scw Exp $ */
/*-
@@ -1033,7 +1033,7 @@ _bus_dmamem_alloc_range(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment,
#endif /* DEBUG_DMA */
m = TAILQ_NEXT(m, pageq);
- for (; m != TAILQ_END(&mlist); m = TAILQ_NEXT(m, pageq)) {
+ for (; m != NULL; m = TAILQ_NEXT(m, pageq)) {
curaddr = VM_PAGE_TO_PHYS(m);
#ifdef DIAGNOSTIC
if (curaddr < low || curaddr >= high) {
diff --git a/sys/arch/aviion/aviion/bus_dma.c b/sys/arch/aviion/aviion/bus_dma.c
index baba8f82370..7b7d0c4d9e2 100644
--- a/sys/arch/aviion/aviion/bus_dma.c
+++ b/sys/arch/aviion/aviion/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.7 2014/07/12 18:44:41 tedu Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.8 2014/09/13 16:06:36 doug Exp $ */
/* $NetBSD: bus_dma.c,v 1.2 2001/06/10 02:31:25 briggs Exp $ */
/*-
@@ -659,7 +659,7 @@ _bus_dmamem_alloc_range(t, size, alignment, boundary, segs, nsegs, rsegs,
segs[curseg].ds_len = PAGE_SIZE;
m = TAILQ_NEXT(m, pageq);
- for (; m != TAILQ_END(&mlist); m = TAILQ_NEXT(m, pageq)) {
+ for (; m != NULL; m = TAILQ_NEXT(m, pageq)) {
curaddr = VM_PAGE_TO_PHYS(m);
#ifdef DIAGNOSTIC
if (curaddr < low || curaddr >= high) {
diff --git a/sys/arch/loongson/loongson/bus_dma.c b/sys/arch/loongson/loongson/bus_dma.c
index e497a9d7dd6..5c3f2decd2b 100644
--- a/sys/arch/loongson/loongson/bus_dma.c
+++ b/sys/arch/loongson/loongson/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.15 2014/07/12 18:44:42 tedu Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.16 2014/09/13 16:06:36 doug Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -680,7 +680,7 @@ _dmamem_alloc_range(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment,
segs[curseg].ds_len = PAGE_SIZE;
m = TAILQ_NEXT(m, pageq);
- for (; m != TAILQ_END(&mlist); m = TAILQ_NEXT(m, pageq)) {
+ for (; m != NULL; m = TAILQ_NEXT(m, pageq)) {
curaddr = VM_PAGE_TO_PHYS(m);
#ifdef DIAGNOSTIC
if (curaddr < low || curaddr >= high) {
diff --git a/sys/arch/octeon/octeon/bus_dma.c b/sys/arch/octeon/octeon/bus_dma.c
index c5de3063c8b..2086aa9cf81 100644
--- a/sys/arch/octeon/octeon/bus_dma.c
+++ b/sys/arch/octeon/octeon/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.12 2014/07/12 18:44:42 tedu Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.13 2014/09/13 16:06:36 doug Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -673,7 +673,7 @@ _dmamem_alloc_range(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment,
segs[curseg].ds_len = PAGE_SIZE;
m = TAILQ_NEXT(m, pageq);
- for (; m != TAILQ_END(&mlist); m = TAILQ_NEXT(m, pageq)) {
+ for (; m != NULL; m = TAILQ_NEXT(m, pageq)) {
curaddr = VM_PAGE_TO_PHYS(m);
#ifdef DIAGNOSTIC
if (curaddr < low || curaddr >= high) {
diff --git a/sys/arch/sgi/sgi/bus_dma.c b/sys/arch/sgi/sgi/bus_dma.c
index 1b5bce22c17..7304c302bd1 100644
--- a/sys/arch/sgi/sgi/bus_dma.c
+++ b/sys/arch/sgi/sgi/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.37 2014/07/17 19:51:58 miod Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.38 2014/09/13 16:06:37 doug Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -728,7 +728,7 @@ _dmamem_alloc_range(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment,
segs[curseg].ds_len = PAGE_SIZE;
m = TAILQ_NEXT(m, pageq);
- for (; m != TAILQ_END(&mlist); m = TAILQ_NEXT(m, pageq)) {
+ for (; m != NULL; m = TAILQ_NEXT(m, pageq)) {
curaddr = VM_PAGE_TO_PHYS(m);
#ifdef DIAGNOSTIC
if (curaddr < low || curaddr >= high) {
diff --git a/sys/arch/vax/vax/bus_dma.c b/sys/arch/vax/vax/bus_dma.c
index edb6a74f612..76f8c39873c 100644
--- a/sys/arch/vax/vax/bus_dma.c
+++ b/sys/arch/vax/vax/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.29 2014/07/12 18:44:43 tedu Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.30 2014/09/13 16:06:37 doug Exp $ */
/* $NetBSD: bus_dma.c,v 1.5 1999/11/13 00:32:20 thorpej Exp $ */
/*-
@@ -727,7 +727,7 @@ _bus_dmamem_alloc_range(t, size, alignment, boundary, segs, nsegs, rsegs,
#endif /* DEBUG_DMA */
m = TAILQ_NEXT(m, pageq);
- for (; m != TAILQ_END(&mlist); m = TAILQ_NEXT(m, pageq)) {
+ for (; m != NULL; m = TAILQ_NEXT(m, pageq)) {
curaddr = VM_PAGE_TO_PHYS(m);
#ifdef DIAGNOSTIC
if (curaddr < low || curaddr >= high) {
diff --git a/sys/dev/ic/if_wi_hostap.c b/sys/dev/ic/if_wi_hostap.c
index 7ce07f3a765..0a47b6a0f16 100644
--- a/sys/dev/ic/if_wi_hostap.c
+++ b/sys/dev/ic/if_wi_hostap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_hostap.c,v 1.44 2014/07/22 13:12:12 mpi Exp $ */
+/* $OpenBSD: if_wi_hostap.c,v 1.45 2014/09/13 16:06:37 doug Exp $ */
/*
* Copyright (c) 2002
@@ -287,8 +287,7 @@ wihap_shutdown(struct wi_softc *sc)
timeout_del(&whi->tmo);
/* Delete all stations from the list. */
- for (sta = TAILQ_FIRST(&whi->sta_list);
- sta != TAILQ_END(&whi->sta_list); sta = next) {
+ for (sta = TAILQ_FIRST(&whi->sta_list); sta != NULL; sta = next) {
timeout_del(&sta->tmo);
if (sc->sc_ic.ic_if.if_flags & IFF_DEBUG)
printf("wihap_shutdown: free(sta=%p)\n", sta);
@@ -351,8 +350,8 @@ wihap_timeout(void *v)
s = splnet();
for (i = 10, sta = TAILQ_FIRST(&whi->sta_list);
- i != 0 && sta != TAILQ_END(&whi->sta_list) &&
- (sta->flags & WI_SIFLAGS_DEAD); i--, sta = next) {
+ i != 0 && sta != NULL && (sta->flags & WI_SIFLAGS_DEAD);
+ i--, sta = next) {
next = TAILQ_NEXT(sta, list);
if (timeout_pending(&sta->tmo)) {
/* Became alive again, move to end of list. */
diff --git a/sys/dev/ic/qla.c b/sys/dev/ic/qla.c
index 41afecbd1e6..d0bd9eb69db 100644
--- a/sys/dev/ic/qla.c
+++ b/sys/dev/ic/qla.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qla.c,v 1.43 2014/07/13 23:10:23 deraadt Exp $ */
+/* $OpenBSD: qla.c,v 1.44 2014/09/13 16:06:37 doug Exp $ */
/*
* Copyright (c) 2011 David Gwynne <dlg@openbsd.org>
@@ -1964,7 +1964,7 @@ qla_do_update(void *xsc, void *x)
}
}
- if (port == TAILQ_END(&sc->sc_ports))
+ if (port == NULL)
qla_update_done(sc,
QLA_UPDATE_TASK_FABRIC_RELOGIN);
continue;
diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c
index c7266f50d44..a155e63e709 100644
--- a/sys/dev/pci/drm/drm_drv.c
+++ b/sys/dev/pci/drm/drm_drv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_drv.c,v 1.129 2014/07/12 18:48:52 tedu Exp $ */
+/* $OpenBSD: drm_drv.c,v 1.130 2014/09/13 16:06:37 doug Exp $ */
/*-
* Copyright 2007-2009 Owain G. Ainsworth <oga@openbsd.org>
* Copyright © 2008 Intel Corporation
@@ -540,8 +540,7 @@ drmclose(dev_t kdev, int flags, int fmt, struct proc *p)
mtx_enter(&dev->event_lock);
struct drmevlist *list = &dev->vbl_events;
- for (ev = TAILQ_FIRST(list); ev != TAILQ_END(list);
- ev = evtmp) {
+ for (ev = TAILQ_FIRST(list); ev != NULL; ev = evtmp) {
evtmp = TAILQ_NEXT(ev, link);
vev = (struct drm_pending_vblank_event *)ev;
if (ev->file_priv == file_priv) {
diff --git a/sys/dev/pci/drm/drm_irq.c b/sys/dev/pci/drm/drm_irq.c
index b7dd919b1ef..e9c871d53c3 100644
--- a/sys/dev/pci/drm/drm_irq.c
+++ b/sys/dev/pci/drm/drm_irq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_irq.c,v 1.54 2014/03/09 11:07:18 jsg Exp $ */
+/* $OpenBSD: drm_irq.c,v 1.55 2014/09/13 16:06:37 doug Exp $ */
/**
* \file drm_irq.c
* IRQ support
@@ -1041,7 +1041,7 @@ void drm_vblank_off(struct drm_device *dev, int crtc)
seq = drm_vblank_count_and_time(dev, crtc, &now);
mtx_enter(&dev->event_lock);
- for (ev = TAILQ_FIRST(list); ev != TAILQ_END(list); ev = tmp) {
+ for (ev = TAILQ_FIRST(list); ev != NULL; ev = tmp) {
tmp = TAILQ_NEXT(ev, link);
vev = (struct drm_pending_vblank_event *)ev;
@@ -1336,7 +1336,7 @@ static void drm_handle_vblank_events(struct drm_device *dev, int crtc)
mtx_enter(&dev->event_lock);
- for (ev = TAILQ_FIRST(list); ev != TAILQ_END(list); ev = tmp) {
+ for (ev = TAILQ_FIRST(list); ev != NULL; ev = tmp) {
tmp = TAILQ_NEXT(ev, link);
vev = (struct drm_pending_vblank_event *)ev;
diff --git a/sys/dev/pci/maestro.c b/sys/dev/pci/maestro.c
index c949f493dc6..890eae1a4b0 100644
--- a/sys/dev/pci/maestro.c
+++ b/sys/dev/pci/maestro.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: maestro.c,v 1.37 2014/07/12 18:48:52 tedu Exp $ */
+/* $OpenBSD: maestro.c,v 1.38 2014/09/13 16:06:37 doug Exp $ */
/* $FreeBSD: /c/ncvs/src/sys/dev/sound/pci/maestro.c,v 1.3 2000/11/21 12:22:11 julian Exp $ */
/*
* FreeBSD's ESS Agogo/Maestro driver
@@ -1819,7 +1819,7 @@ salloc_alloc(salloc_t pool, size_t size)
SLIST_FOREACH(zone, &pool->free, link)
if (zone->size >= size)
break;
- if (zone == SLIST_END(&pool->free))
+ if (zone == NULL)
return NULL;
if (zone->size == size) {
SLIST_REMOVE(&pool->free, zone, salloc_zone, link);
@@ -1847,7 +1847,7 @@ salloc_free(salloc_t pool, caddr_t addr)
if (zone->addr == addr)
break;
#ifdef DIAGNOSTIC
- if (zone == SLIST_END(&pool->used))
+ if (zone == NULL)
panic("salloc_free: freeing unallocated memory");
#endif
SLIST_REMOVE(&pool->used, zone, salloc_zone, link);
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 4a226d4f968..de2f9602e46 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci.c,v 1.103 2014/07/12 18:48:52 tedu Exp $ */
+/* $OpenBSD: pci.c,v 1.104 2014/09/13 16:06:37 doug Exp $ */
/* $NetBSD: pci.c,v 1.31 1997/06/06 23:48:04 thorpej Exp $ */
/*
@@ -574,8 +574,7 @@ pci_detach_devices(struct pci_softc *sc, int flags)
if (ret != 0)
return (ret);
- for (pd = LIST_FIRST(&sc->sc_devs);
- pd != LIST_END(&sc->sc_devs); pd = next) {
+ for (pd = LIST_FIRST(&sc->sc_devs); pd != NULL; pd = next) {
next = LIST_NEXT(pd, pd_next);
free(pd, M_DEVBUF, 0);
}
diff --git a/sys/dev/pci/qle.c b/sys/dev/pci/qle.c
index e15e49b92e6..db578923b1d 100644
--- a/sys/dev/pci/qle.c
+++ b/sys/dev/pci/qle.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qle.c,v 1.31 2014/07/13 23:10:23 deraadt Exp $ */
+/* $OpenBSD: qle.c,v 1.32 2014/09/13 16:06:37 doug Exp $ */
/*
* Copyright (c) 2013, 2014 Jonathan Matthew <jmatthew@openbsd.org>
@@ -2313,7 +2313,7 @@ qle_do_update(void *xsc, void *x)
}
}
- if (port == TAILQ_END(&sc->sc_ports))
+ if (port == NULL)
qle_update_done(sc,
QLE_UPDATE_TASK_FABRIC_RELOGIN);
continue;
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index f20c107c00d..a187da04ce1 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.338 2014/08/01 01:32:09 jsing Exp $ */
+/* $OpenBSD: softraid.c,v 1.339 2014/09/13 16:06:37 doug Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -1170,7 +1170,7 @@ sr_boot_assembly(struct sr_softc *sc)
SLIST_INIT(&kdh);
dk = TAILQ_FIRST(&disklist);
- while (dk != TAILQ_END(&disklist)) {
+ while (dk != NULL) {
/* See if this disk has been checked. */
SLIST_FOREACH(sdk, &sdklist, sdk_link)
@@ -1212,7 +1212,7 @@ sr_boot_assembly(struct sr_softc *sc)
/*
* Create a list of volumes and associate chunks with each volume.
*/
- for (bc = SLIST_FIRST(&bch); bc != SLIST_END(&bch); bc = bcnext) {
+ for (bc = SLIST_FIRST(&bch); bc != NULL; bc = bcnext) {
bcnext = SLIST_NEXT(bc, sbc_link);
SLIST_REMOVE(&bch, bc, sr_boot_chunk, sbc_link);
@@ -1467,10 +1467,10 @@ sr_boot_assembly(struct sr_softc *sc)
/* done with metadata */
unwind:
/* Free boot volumes and associated chunks. */
- for (bv1 = SLIST_FIRST(&bvh); bv1 != SLIST_END(&bvh); bv1 = bv2) {
+ for (bv1 = SLIST_FIRST(&bvh); bv1 != NULL; bv1 = bv2) {
bv2 = SLIST_NEXT(bv1, sbv_link);
- for (bc1 = SLIST_FIRST(&bv1->sbv_chunks);
- bc1 != SLIST_END(&bv1->sbv_chunks); bc1 = bc2) {
+ for (bc1 = SLIST_FIRST(&bv1->sbv_chunks); bc1 != NULL;
+ bc1 = bc2) {
bc2 = SLIST_NEXT(bc1, sbc_link);
if (bc1->sbc_metadata)
free(bc1->sbc_metadata, M_DEVBUF, 0);
@@ -1479,14 +1479,14 @@ unwind:
free(bv1, M_DEVBUF, 0);
}
/* Free keydisks chunks. */
- for (bc1 = SLIST_FIRST(&kdh); bc1 != SLIST_END(&kdh); bc1 = bc2) {
+ for (bc1 = SLIST_FIRST(&kdh); bc1 != NULL; bc1 = bc2) {
bc2 = SLIST_NEXT(bc1, sbc_link);
if (bc1->sbc_metadata)
free(bc1->sbc_metadata, M_DEVBUF, 0);
free(bc1, M_DEVBUF, 0);
}
/* Free unallocated chunks. */
- for (bc1 = SLIST_FIRST(&bch); bc1 != SLIST_END(&bch); bc1 = bc2) {
+ for (bc1 = SLIST_FIRST(&bch); bc1 != NULL; bc1 = bc2) {
bc2 = SLIST_NEXT(bc1, sbc_link);
if (bc1->sbc_metadata)
free(bc1->sbc_metadata, M_DEVBUF, 0);
@@ -1675,7 +1675,7 @@ sr_meta_native_attach(struct sr_discipline *sd, int force)
/* mixed metadata versions; mark bad disks offline */
if (old_meta) {
d = 0;
- for (ch_entry = SLIST_FIRST(cl); ch_entry != SLIST_END(cl);
+ for (ch_entry = SLIST_FIRST(cl); ch_entry != NULL;
ch_entry = ch_next, d++) {
ch_next = SLIST_NEXT(ch_entry, src_link);
@@ -3782,8 +3782,7 @@ sr_chunks_unwind(struct sr_softc *sc, struct sr_chunk_head *cl)
if (!cl)
return;
- for (ch_entry = SLIST_FIRST(cl);
- ch_entry != SLIST_END(cl); ch_entry = ch_next) {
+ for (ch_entry = SLIST_FIRST(cl); ch_entry != NULL; ch_entry = ch_next) {
ch_next = SLIST_NEXT(ch_entry, src_link);
DNPRINTF(SR_D_IOCTL, "%s: sr_chunks_unwind closing: %s\n",
@@ -3831,7 +3830,7 @@ sr_discipline_free(struct sr_discipline *sd)
free(sd->sd_meta_foreign, M_DEVBUF, 0);
som = &sd->sd_meta_opt;
- for (omi = SLIST_FIRST(som); omi != SLIST_END(som); omi = omi_next) {
+ for (omi = SLIST_FIRST(som); omi != NULL; omi = omi_next) {
omi_next = SLIST_NEXT(omi, omi_link);
if (omi->omi_som)
free(omi->omi_som, M_DEVBUF, 0);
diff --git a/sys/dev/softraid_crypto.c b/sys/dev/softraid_crypto.c
index 3d7a6368bdf..40160fd6bc1 100644
--- a/sys/dev/softraid_crypto.c
+++ b/sys/dev/softraid_crypto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_crypto.c,v 1.110 2014/07/12 18:48:51 tedu Exp $ */
+/* $OpenBSD: softraid_crypto.c,v 1.111 2014/09/13 16:06:37 doug Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Hans-Joerg Hoexer <hshoexer@openbsd.org>
@@ -887,7 +887,7 @@ sr_crypto_read_key_disk(struct sr_discipline *sd, dev_t dev)
open = 0;
done:
- for (omi = SLIST_FIRST(&som); omi != SLIST_END(&som); omi = omi_next) {
+ for (omi = SLIST_FIRST(&som); omi != NULL; omi = omi_next) {
omi_next = SLIST_NEXT(omi, omi_link);
if (omi->omi_som)
free(omi->omi_som, M_DEVBUF, 0);
diff --git a/sys/kern/spec_vnops.c b/sys/kern/spec_vnops.c
index c4e8006353b..484e17a5e4b 100644
--- a/sys/kern/spec_vnops.c
+++ b/sys/kern/spec_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spec_vnops.c,v 1.78 2013/10/30 03:16:49 guenther Exp $ */
+/* $OpenBSD: spec_vnops.c,v 1.79 2014/09/13 16:06:37 doug Exp $ */
/* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */
/*
@@ -423,8 +423,7 @@ spec_fsync(void *v)
*/
loop:
s = splbio();
- for (bp = LIST_FIRST(&vp->v_dirtyblkhd);
- bp != LIST_END(&vp->v_dirtyblkhd); bp = nbp) {
+ for (bp = LIST_FIRST(&vp->v_dirtyblkhd); bp != NULL; bp = nbp) {
nbp = LIST_NEXT(bp, b_vnbufs);
if ((bp->b_flags & B_BUSY))
continue;
diff --git a/sys/kern/subr_extent.c b/sys/kern/subr_extent.c
index 3ff5210e6c3..55ef07123b6 100644
--- a/sys/kern/subr_extent.c
+++ b/sys/kern/subr_extent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_extent.c,v 1.52 2014/08/17 09:48:55 dlg Exp $ */
+/* $OpenBSD: subr_extent.c,v 1.53 2014/09/13 16:06:37 doug Exp $ */
/* $NetBSD: subr_extent.c,v 1.7 1996/11/21 18:46:34 cgd Exp $ */
/*-
@@ -272,8 +272,7 @@ extent_destroy(struct extent *ex)
#endif
/* Free all region descriptors in extent. */
- for (rp = LIST_FIRST(&ex->ex_regions);
- rp != LIST_END(&ex->ex_regions); ) {
+ for (rp = LIST_FIRST(&ex->ex_regions); rp != NULL; ) {
orp = rp;
rp = LIST_NEXT(rp, er_link);
LIST_REMOVE(orp, er_link);
@@ -697,7 +696,7 @@ extent_do_alloc(struct extent *ex, u_long substart, u_long subend,
if (last != NULL && last->er_end >= newstart)
newstart = extent_align((last->er_end + 1), alignment, skew);
- for (; rp != LIST_END(&ex->ex_regions); rp = LIST_NEXT(rp, er_link)) {
+ for (; rp != NULL; rp = LIST_NEXT(rp, er_link)) {
/*
* If the region pasts the subend, bail out and see
* if we fit against the subend.
diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c
index ca8e25a3623..de70c0bd815 100644
--- a/sys/kern/sysv_sem.c
+++ b/sys/kern/sysv_sem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysv_sem.c,v 1.49 2014/07/13 15:29:04 tedu Exp $ */
+/* $OpenBSD: sysv_sem.c,v 1.50 2014/09/13 16:06:37 doug Exp $ */
/* $NetBSD: sysv_sem.c,v 1.26 1996/02/09 19:00:25 christos Exp $ */
/*
@@ -184,11 +184,11 @@ void
semundo_clear(int semid, int semnum)
{
struct sem_undo *suptr = SLIST_FIRST(&semu_list);
- struct sem_undo *suprev = SLIST_END(&semu_list);
+ struct sem_undo *suprev = NULL;
struct undo *sunptr;
int i;
- while (suptr != SLIST_END(&semu_list)) {
+ while (suptr != NULL) {
sunptr = &suptr->un_ent[0];
for (i = 0; i < suptr->un_cnt; i++, sunptr++) {
if (sunptr->un_id == semid) {
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 4c82103fd07..a1775c27fd3 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_cache.c,v 1.36 2013/11/27 15:48:43 jsing Exp $ */
+/* $OpenBSD: vfs_cache.c,v 1.37 2014/09/13 16:06:37 doug Exp $ */
/* $NetBSD: vfs_cache.c,v 1.13 1996/02/04 02:18:09 christos Exp $ */
/*
@@ -458,8 +458,7 @@ cache_purgevfs(struct mount *mp)
struct namecache *ncp, *nxtcp;
/* whack the regular entries */
- for (ncp = TAILQ_FIRST(&nclruhead); ncp != TAILQ_END(&nclruhead);
- ncp = nxtcp) {
+ for (ncp = TAILQ_FIRST(&nclruhead); ncp != NULL; ncp = nxtcp) {
if (ncp->nc_dvp == NULL || ncp->nc_dvp->v_mount != mp) {
nxtcp = TAILQ_NEXT(ncp, nc_lru);
continue;
@@ -470,8 +469,7 @@ cache_purgevfs(struct mount *mp)
nxtcp = TAILQ_FIRST(&nclruhead);
}
/* whack the negative entries */
- for (ncp = TAILQ_FIRST(&nclruneghead); ncp != TAILQ_END(&nclruneghead);
- ncp = nxtcp) {
+ for (ncp = TAILQ_FIRST(&nclruneghead); ncp != NULL; ncp = nxtcp) {
if (ncp->nc_dvp == NULL || ncp->nc_dvp->v_mount != mp) {
nxtcp = TAILQ_NEXT(ncp, nc_neg);
continue;
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index a26fbe2e851..7d0fffac230 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.218 2014/07/13 15:00:40 tedu Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.219 2014/09/13 16:06:37 doug Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -1887,8 +1887,7 @@ vflushbuf(struct vnode *vp, int sync)
loop:
s = splbio();
- for (bp = LIST_FIRST(&vp->v_dirtyblkhd);
- bp != LIST_END(&vp->v_dirtyblkhd); bp = nbp) {
+ for (bp = LIST_FIRST(&vp->v_dirtyblkhd); bp != NULL; bp = nbp) {
nbp = LIST_NEXT(bp, b_vnbufs);
if ((bp->b_flags & B_BUSY))
continue;
diff --git a/sys/scsi/ses.c b/sys/scsi/ses.c
index 456aa656fd3..53ca6bbe10e 100644
--- a/sys/scsi/ses.c
+++ b/sys/scsi/ses.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ses.c,v 1.52 2014/07/12 18:50:25 tedu Exp $ */
+/* $OpenBSD: ses.c,v 1.53 2014/09/13 16:06:37 doug Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
@@ -647,7 +647,7 @@ ses_bio_blink(struct ses_softc *sc, struct bioc_blink *blink)
break;
}
- if (slot == TAILQ_END(&sc->sc_slots)) {
+ if (slot == NULL) {
rw_exit_write(&sc->sc_lock);
return (EINVAL);
}