mirror of
https://github.com/openbsd/src.git
synced 2025-01-10 06:47:55 -08:00
Replace all queue *_END macro calls except CIRCLEQ_END with NULL.
CIRCLEQ_* is deprecated and not called in the tree. The other queue types have *_END macros which were added for symmetry with CIRCLEQ_END. They are defined as NULL. There's no reason to keep the other *_END macro calls. ok millert@
This commit is contained in:
parent
8830d138e9
commit
abcbcc4d80
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: md5.c,v 1.76 2014/06/19 15:30:49 millert Exp $ */
|
||||
/* $OpenBSD: md5.c,v 1.77 2014/09/13 16:06:36 doug Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001,2003,2005-2007,2010,2013,2014
|
||||
@ -263,7 +263,7 @@ main(int argc, char **argv)
|
||||
strcmp(hf->name, hftmp->name) == 0)
|
||||
break;
|
||||
}
|
||||
if (hftmp == TAILQ_END(&hl))
|
||||
if (hftmp == NULL)
|
||||
hash_insert(&hl, hf, base64);
|
||||
}
|
||||
break;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: event-internal.h,v 1.6 2010/04/21 20:02:40 nicm Exp $ */
|
||||
/* $OpenBSD: event-internal.h,v 1.7 2014/09/13 16:06:36 doug Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000-2004 Niels Provos <provos@citi.umich.edu>
|
||||
@ -74,11 +74,10 @@ struct event_base {
|
||||
/* Internal use only: Functions that might be missing from <sys/queue.h> */
|
||||
#ifndef HAVE_TAILQFOREACH
|
||||
#define TAILQ_FIRST(head) ((head)->tqh_first)
|
||||
#define TAILQ_END(head) NULL
|
||||
#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
|
||||
#define TAILQ_FOREACH(var, head, field) \
|
||||
for((var) = TAILQ_FIRST(head); \
|
||||
(var) != TAILQ_END(head); \
|
||||
(var) != NULL; \
|
||||
(var) = TAILQ_NEXT(var, field))
|
||||
#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
|
||||
(elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: parse.y,v 1.638 2014/08/23 00:11:03 pelikan Exp $ */
|
||||
/* $OpenBSD: parse.y,v 1.639 2014/09/13 16:06:36 doug Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Markus Friedl. All rights reserved.
|
||||
@ -1152,8 +1152,8 @@ tabledef : TABLE '<' STRING '>' table_opts {
|
||||
YYERROR;
|
||||
}
|
||||
free($3);
|
||||
for (ti = SIMPLEQ_FIRST(&$5.init_nodes);
|
||||
ti != SIMPLEQ_END(&$5.init_nodes); ti = nti) {
|
||||
for (ti = SIMPLEQ_FIRST(&$5.init_nodes); ti != NULL;
|
||||
ti = nti) {
|
||||
if (ti->file)
|
||||
free(ti->file);
|
||||
for (h = ti->host; h != NULL; h = nh) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: pfctl_optimize.c,v 1.33 2013/11/22 04:12:48 deraadt Exp $ */
|
||||
/* $OpenBSD: pfctl_optimize.c,v 1.34 2014/09/13 16:06:36 doug Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004 Mike Frantzen <frantzen@openbsd.org>
|
||||
@ -844,7 +844,7 @@ block_feedback(struct pfctl *pf, struct superblock *block)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (por2 == TAILQ_END(&block->sb_rules))
|
||||
if (por2 == NULL)
|
||||
TAILQ_INSERT_TAIL(&block->sb_rules, por1, por_entry);
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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. */
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: rip.c,v 1.14 2013/11/20 20:54:34 deraadt Exp $ */
|
||||
/* $OpenBSD: rip.c,v 1.15 2014/09/13 16:06:37 doug Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Alexey Vatchenko <av@bsdua.org>
|
||||
@ -244,7 +244,7 @@ parse_tracks_final(struct track_pair_head *head)
|
||||
{
|
||||
struct track_pair *tp;
|
||||
|
||||
while ((tp = TAILQ_FIRST(head)) != TAILQ_END(head)) {
|
||||
while ((tp = TAILQ_FIRST(head)) != NULL) {
|
||||
TAILQ_REMOVE(head, tp, list);
|
||||
free(tp);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: ftp-proxy.c,v 1.28 2013/03/15 13:31:27 benno Exp $ */
|
||||
/* $OpenBSD: ftp-proxy.c,v 1.29 2014/09/13 16:06:37 doug Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004, 2005 Camiel Dobbelaar, <cd@sentia.nl>
|
||||
@ -322,7 +322,7 @@ exit_daemon(void)
|
||||
{
|
||||
struct session *s, *next;
|
||||
|
||||
for (s = LIST_FIRST(&sessions); s != LIST_END(&sessions); s = next) {
|
||||
for (s = LIST_FIRST(&sessions); s != NULL; s = next) {
|
||||
next = LIST_NEXT(s, entry);
|
||||
end_session(s);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: namespace.c,v 1.12 2012/06/16 00:08:32 jmatthew Exp $ */
|
||||
/* $OpenBSD: namespace.c,v 1.13 2014/09/13 16:06:37 doug Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
|
||||
@ -526,8 +526,8 @@ namespace_cancel_conn(struct conn *conn)
|
||||
struct request *req, *next;
|
||||
|
||||
TAILQ_FOREACH(ns, &conf->namespaces, next) {
|
||||
for (req = TAILQ_FIRST(&ns->request_queue);
|
||||
req != TAILQ_END(&ns->request_queue); req = next) {
|
||||
for (req = TAILQ_FIRST(&ns->request_queue); req != NULL;
|
||||
req = next) {
|
||||
next = TAILQ_NEXT(req, next);
|
||||
|
||||
if (req->conn == conn) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: config.c,v 1.19 2013/05/08 00:15:03 gsoares Exp $ */
|
||||
/* $OpenBSD: config.c,v 1.20 2014/09/13 16:06:37 doug Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 Mark Kettenis
|
||||
@ -433,7 +433,7 @@ hvmd_alloc_frag(uint64_t base)
|
||||
}
|
||||
}
|
||||
|
||||
if (frag == TAILQ_END(&free_frags))
|
||||
if (frag == NULL)
|
||||
return -1;
|
||||
|
||||
TAILQ_REMOVE(&free_frags, frag, link);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: mdstore.c,v 1.6 2012/11/24 23:02:43 kettenis Exp $ */
|
||||
/* $OpenBSD: mdstore.c,v 1.7 2014/09/13 16:06:37 doug Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 Mark Kettenis
|
||||
@ -269,7 +269,7 @@ mdstore_select(struct ds_conn *dc, const char *name)
|
||||
TAILQ_FOREACH(dcs, &dc->services, link)
|
||||
if (strcmp(dcs->service->ds_svc_id, "mdstore") == 0)
|
||||
break;
|
||||
assert(dcs != TAILQ_END(&dc->services));
|
||||
assert(dcs != NULL);
|
||||
|
||||
mr = xzalloc(len);
|
||||
mr->msg_type = DS_DATA;
|
||||
@ -297,7 +297,7 @@ mdstore_delete(struct ds_conn *dc, const char *name)
|
||||
TAILQ_FOREACH(dcs, &dc->services, link)
|
||||
if (strcmp(dcs->service->ds_svc_id, "mdstore") == 0)
|
||||
break;
|
||||
assert(dcs != TAILQ_END(&dc->services));
|
||||
assert(dcs != NULL);
|
||||
|
||||
mr = xzalloc(len);
|
||||
mr->msg_type = DS_DATA;
|
||||
@ -335,7 +335,7 @@ mdstore_download(struct ds_conn *dc, const char *name)
|
||||
TAILQ_FOREACH(dcs, &dc->services, link)
|
||||
if (strcmp(dcs->service->ds_svc_id, "mdstore") == 0)
|
||||
break;
|
||||
assert(dcs != TAILQ_END(&dc->services));
|
||||
assert(dcs != NULL);
|
||||
|
||||
if (asprintf(&path, "%s/hv.md", name) == -1)
|
||||
err(1, "asprintf");
|
||||
|
Loading…
Reference in New Issue
Block a user