diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2011-04-07 15:30:17 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2011-04-07 15:30:17 +0000 |
commit | 470f59fa3f11b7317fc5907cfef6043f2104bcc6 (patch) | |
tree | 50aedec19587d2927b807e6719da0022055c56df | |
parent | 1d2ed5cc87538f3c2a6389c586a609a8b73610b7 (diff) |
Do not use NULL in integer comparisons. No functional change.
ok matthew@ tedu@, also eyeballed by at least krw@ oga@ kettenis@ jsg@
63 files changed, 180 insertions, 181 deletions
diff --git a/sys/arch/amd64/amd64/bios.c b/sys/arch/amd64/amd64/bios.c index 8ead81728dd..dd73d9a58c4 100644 --- a/sys/arch/amd64/amd64/bios.c +++ b/sys/arch/amd64/amd64/bios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bios.c,v 1.20 2010/04/20 22:05:41 tedu Exp $ */ +/* $OpenBSD: bios.c,v 1.21 2011/04/07 15:30:13 miod Exp $ */ /* * Copyright (c) 2006 Gordon Willem Klok <gklok@cogeco.ca> * @@ -218,7 +218,7 @@ smbios_find_table(u_int8_t type, struct smbtable *st) if (hdr->type == type) { va = (u_int8_t *)hdr + hdr->size; for (; va + 1 < end; va++) - if (*va == NULL && *(va + 1) == NULL) + if (*va == 0 && *(va + 1) == 0) break; va+= 2; tcount = st->cookie >> 16; @@ -239,7 +239,7 @@ smbios_find_table(u_int8_t type, struct smbtable *st) break; va+= hdr->size; for (; va + 1 < end; va++) - if (*va == NULL && *(va + 1) == NULL) + if (*va == 0 && *(va + 1) == 0) break; va+=2; } diff --git a/sys/arch/amd64/amd64/sg_dma.c b/sys/arch/amd64/amd64/sg_dma.c index c66e27dc2ae..67d6eee4659 100644 --- a/sys/arch/amd64/amd64/sg_dma.c +++ b/sys/arch/amd64/amd64/sg_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sg_dma.c,v 1.9 2010/04/20 23:12:01 phessler Exp $ */ +/* $OpenBSD: sg_dma.c,v 1.10 2011/04/07 15:30:13 miod Exp $ */ /* * Copyright (c) 2009 Owain G. Ainsworth <oga@openbsd.org> * @@ -91,7 +91,7 @@ sg_dmatag_init(char *name, void *hdl, bus_addr_t start, bus_size_t size, return (NULL); cookie->sg_ex = extent_create(name, start, start + size - 1, - M_DEVBUF, NULL, NULL, EX_NOWAIT | EX_NOCOALESCE); + M_DEVBUF, NULL, 0, EX_NOWAIT | EX_NOCOALESCE); if (cookie->sg_ex == NULL) { free(cookie, M_DEVBUF); return (NULL); @@ -604,7 +604,7 @@ sg_dmamap_append_range(bus_dma_tag_t t, bus_dmamap_t map, paddr_t pa, sgend = sgstart + length - 1; #ifdef DIAGNOSTIC - if (sgstart == NULL || sgstart > sgend) { + if (sgstart == 0 || sgstart > sgend) { printf("append range invalid mapping for %lx " "(0x%llx - 0x%llx)\n", pa, sgstart, sgend); map->dm_nsegs = 0; @@ -876,7 +876,7 @@ sg_iomap_insert_page(struct sg_page_map *spm, paddr_t pa) e = &spm->spm_map[spm->spm_pagecnt]; e->spe_pa = pa; - e->spe_va = NULL; + e->spe_va = 0; e = SPLAY_INSERT(sg_page_tree, &spm->spm_tree, e); @@ -937,7 +937,7 @@ sg_iomap_translate(struct sg_page_map *spm, paddr_t pa) e = SPLAY_FIND(sg_page_tree, &spm->spm_tree, &pe); if (e == NULL) - return (NULL); + return (bus_addr_t)0; return (e->spe_va | offset); } diff --git a/sys/arch/arm/xscale/pxa27x_udc.c b/sys/arch/arm/xscale/pxa27x_udc.c index 23a06d39a6f..e606e3f4147 100644 --- a/sys/arch/arm/xscale/pxa27x_udc.c +++ b/sys/arch/arm/xscale/pxa27x_udc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa27x_udc.c,v 1.27 2010/09/07 16:21:35 deraadt Exp $ */ +/* $OpenBSD: pxa27x_udc.c,v 1.28 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 2007 Dale Rahn <drahn@openbsd.org> @@ -193,7 +193,7 @@ pxaudc_attach(struct pxaudc_softc *sc, void *aux) printf(": unable to establish connect interrupt\n"); pxa2x0_intr_disestablish(sc->sc_ih); bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_size); - sc->sc_ioh = NULL; + sc->sc_ioh = 0; sc->sc_size = 0; return; } diff --git a/sys/arch/arm/xscale/pxa2x0_mmc.c b/sys/arch/arm/xscale/pxa2x0_mmc.c index b8be421d9d4..6451c19677e 100644 --- a/sys/arch/arm/xscale/pxa2x0_mmc.c +++ b/sys/arch/arm/xscale/pxa2x0_mmc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0_mmc.c,v 1.9 2009/09/03 21:40:29 marex Exp $ */ +/* $OpenBSD: pxa2x0_mmc.c,v 1.10 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 2007 Uwe Stuehler <uwe@openbsd.org> @@ -203,9 +203,9 @@ fail: pxa2x0_gpio_intr_disestablish(sc->sc_card_ih); sc->sc_card_ih = NULL; } - if (sc->sc_ioh != NULL) { + if (sc->sc_ioh != 0) { bus_space_unmap(sc->sc_iot, sc->sc_ioh, PXA2X0_MMC_SIZE); - sc->sc_ioh = NULL; + sc->sc_ioh = 0; } pxa2x0_clkman_config(CKEN_MMC, 0); } diff --git a/sys/arch/aviion/dev/if_le_syscon.c b/sys/arch/aviion/dev/if_le_syscon.c index 078126b77b9..5c19dfdf4c3 100644 --- a/sys/arch/aviion/dev/if_le_syscon.c +++ b/sys/arch/aviion/dev/if_le_syscon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le_syscon.c,v 1.11 2010/12/31 21:38:07 miod Exp $ */ +/* $OpenBSD: if_le_syscon.c,v 1.12 2011/04/07 15:30:15 miod Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -145,7 +145,7 @@ le_syscon_attach(struct device *parent, struct device *self, void *aux) } va = uvm_km_valloc(kernel_map, ptoa(etherpages)); - if (va == NULL) { + if (va == 0) { printf(": can't map descriptor memory\n"); uvm_pglistfree(&pglist); return; diff --git a/sys/arch/aviion/dev/oosiop_syscon.c b/sys/arch/aviion/dev/oosiop_syscon.c index 8fd04b27191..e2ec0f46ce0 100644 --- a/sys/arch/aviion/dev/oosiop_syscon.c +++ b/sys/arch/aviion/dev/oosiop_syscon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: oosiop_syscon.c,v 1.3 2010/04/24 18:44:27 miod Exp $ */ +/* $OpenBSD: oosiop_syscon.c,v 1.4 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 2010 Miodrag Vallat. @@ -95,7 +95,7 @@ oosiop_syscon_attach(struct device *parent, struct device *self, void *aux) } sc->sc_bst = ca->ca_iot; sc->sc_bsh = ioh; - sc->sc_dmat = NULL; /* no real use of tag yet */ + sc->sc_dmat = 0; /* no real use of tag yet */ sc->sc_freq = 33333333; /* XXX 25MHz models? */ sc->sc_chip = OOSIOP_700; diff --git a/sys/arch/aviion/dev/vme.c b/sys/arch/aviion/dev/vme.c index 88b982fd082..4c82e2dc31e 100644 --- a/sys/arch/aviion/dev/vme.c +++ b/sys/arch/aviion/dev/vme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vme.c,v 1.11 2010/12/31 21:38:08 miod Exp $ */ +/* $OpenBSD: vme.c,v 1.12 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 2006, 2007, 2010 Miodrag Vallat. * @@ -497,7 +497,7 @@ vme_map_r(const struct vme_range *r, paddr_t pa, psize_t len, int flags, u_int pg; ova = va = uvm_km_valloc(kernel_map, len); - if (va == NULL) + if (va == 0) return ENOMEM; pa += r->vr_base; diff --git a/sys/arch/beagle/dev/gptimer.c b/sys/arch/beagle/dev/gptimer.c index a3afbb62209..8e5ae8c26e1 100644 --- a/sys/arch/beagle/dev/gptimer.c +++ b/sys/arch/beagle/dev/gptimer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gptimer.c,v 1.4 2010/08/07 03:50:01 krw Exp $ */ +/* $OpenBSD: gptimer.c,v 1.5 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org> * @@ -391,7 +391,7 @@ delay(u_int usecs) for (j = 100; j > 0; j--) ; - if (gptimer_ioh1 == NULL) { + if (gptimer_ioh1 == 0) { /* BAH */ for (; usecs > 0; usecs--) for (j = 100; j > 0; j--) diff --git a/sys/arch/hp300/hp300/wscons_machdep.c b/sys/arch/hp300/hp300/wscons_machdep.c index 5b4617e61ef..2e67b116217 100644 --- a/sys/arch/hp300/hp300/wscons_machdep.c +++ b/sys/arch/hp300/hp300/wscons_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wscons_machdep.c,v 1.10 2010/04/15 20:38:11 miod Exp $ */ +/* $OpenBSD: wscons_machdep.c,v 1.11 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -221,7 +221,7 @@ wscnprobe(struct consdev *cp) /* Map current PA. */ pa = (paddr_t)dio_scodetopa(scode); va = (vaddr_t)iomap((caddr_t)pa, PAGE_SIZE); - if (va == NULL) + if (va == 0) continue; /* Check to see if hardware exists. */ @@ -237,7 +237,7 @@ wscnprobe(struct consdev *cp) mapsize = DIO_SIZE(scode, va); iounmap((caddr_t)va, PAGE_SIZE); va = (vaddr_t)iomap((caddr_t)pa, mapsize); - if (va == NULL) + if (va == 0) continue; goto found; } else @@ -255,7 +255,7 @@ wscnprobe(struct consdev *cp) /* Map current PA. */ pa = (paddr_t)sgc_slottopa(scode); va = (vaddr_t)iomap((caddr_t)pa, PAGE_SIZE); - if (va == NULL) + if (va == 0) continue; /* Check to see if hardware exists. */ diff --git a/sys/arch/hppa/dev/astro.c b/sys/arch/hppa/dev/astro.c index 89fd4c56eae..afe811c9b21 100644 --- a/sys/arch/hppa/dev/astro.c +++ b/sys/arch/hppa/dev/astro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: astro.c,v 1.12 2010/08/07 03:50:01 krw Exp $ */ +/* $OpenBSD: astro.c,v 1.13 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 2007 Mark Kettenis @@ -640,7 +640,7 @@ iommu_iomap_insert_page(struct iommu_map_state *ims, vaddr_t va, paddr_t pa) e->ipe_pa = pa; e->ipe_va = va; - e->ipe_dva = NULL; + e->ipe_dva = 0; e = SPLAY_INSERT(iommu_page_tree, &ipm->ipm_tree, e); diff --git a/sys/arch/hppa64/dev/astro.c b/sys/arch/hppa64/dev/astro.c index dc7e41cd8d4..d6a5b4572c7 100644 --- a/sys/arch/hppa64/dev/astro.c +++ b/sys/arch/hppa64/dev/astro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: astro.c,v 1.4 2010/08/07 03:50:01 krw Exp $ */ +/* $OpenBSD: astro.c,v 1.5 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 2007 Mark Kettenis @@ -640,7 +640,7 @@ iommu_iomap_insert_page(struct iommu_map_state *ims, vaddr_t va, paddr_t pa) e->ipe_pa = pa; e->ipe_va = va; - e->ipe_dva = NULL; + e->ipe_dva = 0; e = SPLAY_INSERT(iommu_page_tree, &ipm->ipm_tree, e); diff --git a/sys/arch/i386/i386/bios.c b/sys/arch/i386/i386/bios.c index 0d1468ca79b..ff2c92a7291 100644 --- a/sys/arch/i386/i386/bios.c +++ b/sys/arch/i386/i386/bios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bios.c,v 1.88 2010/11/22 21:08:07 miod Exp $ */ +/* $OpenBSD: bios.c,v 1.89 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 1997-2001 Michael Shalayeff @@ -756,7 +756,7 @@ smbios_find_table(u_int8_t type, struct smbtable *st) if (hdr->type == type) { va = (u_int8_t *)hdr + hdr->size; for (; va + 1 < end; va++) - if (*va == NULL && *(va + 1) == NULL) + if (*va == 0 && *(va + 1) == 0) break; va+= 2; tcount = st->cookie >> 16; @@ -777,7 +777,7 @@ smbios_find_table(u_int8_t type, struct smbtable *st) break; va+= hdr->size; for (; va + 1 < end; va++) - if (*va == NULL && *(va + 1) == NULL) + if (*va == 0 && *(va + 1) == 0) break; va+=2; } diff --git a/sys/arch/i386/i386/sg_dma.c b/sys/arch/i386/i386/sg_dma.c index 9f924258ebe..1f45bf21c83 100644 --- a/sys/arch/i386/i386/sg_dma.c +++ b/sys/arch/i386/i386/sg_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sg_dma.c,v 1.6 2010/04/20 22:05:41 tedu Exp $ */ +/* $OpenBSD: sg_dma.c,v 1.7 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 2009 Owain G. Ainsworth <oga@openbsd.org> * @@ -91,7 +91,7 @@ sg_dmatag_init(char *name, void *hdl, bus_addr_t start, bus_size_t size, return (NULL); cookie->sg_ex = extent_create(name, start, start + size - 1, - M_DEVBUF, NULL, NULL, EX_NOWAIT | EX_NOCOALESCE); + M_DEVBUF, NULL, 0, EX_NOWAIT | EX_NOCOALESCE); if (cookie->sg_ex == NULL) { free(cookie, M_DEVBUF); return (NULL); @@ -604,7 +604,7 @@ sg_dmamap_append_range(bus_dma_tag_t t, bus_dmamap_t map, paddr_t pa, sgend = sgstart + length - 1; #ifdef DIAGNOSTIC - if (sgstart == NULL || sgstart > sgend) { + if (sgstart == 0 || sgstart > sgend) { printf("append range invalid mapping for %lx " "(0x%llx - 0x%llx)\n", pa, sgstart, sgend); map->dm_nsegs = 0; @@ -876,7 +876,7 @@ sg_iomap_insert_page(struct sg_page_map *spm, paddr_t pa) e = &spm->spm_map[spm->spm_pagecnt]; e->spe_pa = pa; - e->spe_va = NULL; + e->spe_va = 0; e = SPLAY_INSERT(sg_page_tree, &spm->spm_tree, e); @@ -937,7 +937,7 @@ sg_iomap_translate(struct sg_page_map *spm, paddr_t pa) e = SPLAY_FIND(sg_page_tree, &spm->spm_tree, &pe); if (e == NULL) - return (NULL); + return (0); return (e->spe_va | offset); } diff --git a/sys/arch/mac68k/dev/if_sn.c b/sys/arch/mac68k/dev/if_sn.c index b60fbe50eb0..4a3bf5a08e5 100644 --- a/sys/arch/mac68k/dev/if_sn.c +++ b/sys/arch/mac68k/dev/if_sn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sn.c,v 1.54 2010/03/31 19:46:27 miod Exp $ */ +/* $OpenBSD: if_sn.c,v 1.55 2011/04/07 15:30:15 miod Exp $ */ /* $NetBSD: if_sn.c,v 1.13 1997/04/25 03:40:10 briggs Exp $ */ /* @@ -124,7 +124,7 @@ snsetup(struct sn_softc *sc, u_int8_t *lladdr) * Map the pages uncached. */ sc->space = uvm_km_valloc(kernel_map, SN_NPAGES * PAGE_SIZE); - if (sc->space == NULL) { + if (sc->space == 0) { printf(": can't map descriptor memory\n"); uvm_pglistfree(&pglist); return (ENOMEM); diff --git a/sys/arch/mips64/mips64/cpu.c b/sys/arch/mips64/mips64/cpu.c index 863d261bc9c..b01259b5845 100644 --- a/sys/arch/mips64/mips64/cpu.c +++ b/sys/arch/mips64/mips64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.37 2011/03/31 20:37:44 miod Exp $ */ +/* $OpenBSD: cpu.c,v 1.38 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 1997-2004 Opsycon AB (www.opsycon.se) @@ -55,7 +55,7 @@ struct cfattach cpu_ca = { sizeof(struct device), cpumatch, cpuattach }; struct cfdriver cpu_cd = { - NULL, "cpu", DV_DULL, NULL, 0 + NULL, "cpu", DV_DULL, }; int diff --git a/sys/arch/mips64/mips64/sendsig.c b/sys/arch/mips64/mips64/sendsig.c index 0ad5276b1c8..21b925b71e2 100644 --- a/sys/arch/mips64/mips64/sendsig.c +++ b/sys/arch/mips64/mips64/sendsig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sendsig.c,v 1.13 2010/06/26 23:24:43 guenther Exp $ */ +/* $OpenBSD: sendsig.c,v 1.14 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -184,7 +184,7 @@ bail: * Build the argument list for the signal handler. */ regs->a0 = sig; - regs->a1 = (psp->ps_siginfo & sigmask(sig)) ? (register_t)&fp->sf_si : NULL; + regs->a1 = (psp->ps_siginfo & sigmask(sig)) ? (register_t)&fp->sf_si : 0; regs->a2 = (register_t)&fp->sf_sc; regs->a3 = (register_t)catcher; diff --git a/sys/arch/mvme68k/dev/vme.c b/sys/arch/mvme68k/dev/vme.c index 73f0d830a16..bfdeea0de8c 100644 --- a/sys/arch/mvme68k/dev/vme.c +++ b/sys/arch/mvme68k/dev/vme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vme.c,v 1.29 2010/06/27 22:04:03 miod Exp $ */ +/* $OpenBSD: vme.c,v 1.30 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -113,7 +113,7 @@ vme_map(bus_addr_t addr, bus_size_t size, int flags, bus_space_handle_t *ret) vaddr_t map; map = (vaddr_t)mapiodev((paddr_t)addr, size); - if (map == NULL) + if (map == 0) return ENOMEM; *ret = (bus_space_handle_t)map; @@ -633,14 +633,14 @@ vme2chip_map(base, len, dwidth) case 16: if (base < VME2_D16STARTPHYS || base + (u_long)len > VME2_D16ENDPHYS) - return (NULL); + return (0); return (base); case 32: if (base < VME2_D32STARTVME) - return (NULL); + return (0); return (base - VME2_D32STARTVME + VME2_D32STARTPHYS); default: - return (NULL); + return (0); } } diff --git a/sys/arch/mvme68k/dev/vmel.c b/sys/arch/mvme68k/dev/vmel.c index 4ea722eb156..8ca896d0bd6 100644 --- a/sys/arch/mvme68k/dev/vmel.c +++ b/sys/arch/mvme68k/dev/vmel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmel.c,v 1.17 2010/12/26 15:40:59 miod Exp $ */ +/* $OpenBSD: vmel.c,v 1.18 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -169,7 +169,7 @@ vmelmmap(dev, off, prot) #ifdef DEBUG printf("vmel %llx pa %p\n", off, pa); #endif - if (pa == NULL) + if (pa == 0) return (-1); return (pa); } diff --git a/sys/arch/mvme68k/mvme68k/autoconf.c b/sys/arch/mvme68k/mvme68k/autoconf.c index 135279a528b..b9267d142ff 100644 --- a/sys/arch/mvme68k/mvme68k/autoconf.c +++ b/sys/arch/mvme68k/mvme68k/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.46 2010/11/18 21:13:19 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.47 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -148,7 +148,7 @@ mapiodev(pa, size) vaddr_t va, iova; if (size <= 0) - return NULL; + return 0; base = pa & PAGE_MASK; pa = trunc_page(pa); @@ -158,7 +158,7 @@ mapiodev(pa, size) EX_NOWAIT | EX_MALLOCOK, &iova); if (error != 0) - return NULL; + return 0; va = iova; while (size != 0) { diff --git a/sys/arch/mvme88k/dev/mainbus.c b/sys/arch/mvme88k/dev/mainbus.c index 8e74b5cc56d..1d805faeeb1 100644 --- a/sys/arch/mvme88k/dev/mainbus.c +++ b/sys/arch/mvme88k/dev/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.25 2010/12/23 20:05:08 miod Exp $ */ +/* $OpenBSD: mainbus.c,v 1.26 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 2004, Miodrag Vallat. @@ -95,7 +95,7 @@ mainbus_map(bus_addr_t addr, bus_size_t size, int flags, vaddr_t map; map = mapiodev((paddr_t)addr, size); - if (map == NULL) + if (map == 0) return ENOMEM; *ret = (bus_space_handle_t)map; @@ -140,11 +140,11 @@ mapiodev(paddr_t addr, int _size) /* sanity checks */ if (_size <= 0) - return NULL; + return 0; size = (psize_t)_size; epa = addr + size; if (epa < addr && epa != 0) - return NULL; + return 0; /* check for 1:1 mapping */ if (addr >= bs_obio_start) { @@ -152,7 +152,7 @@ mapiodev(paddr_t addr, int _size) return ((vaddr_t)addr); else if (addr <= bs_obio_end) /* across obio and non-obio, not supported */ - return NULL; + return 0; } pa = trunc_page(addr); @@ -165,13 +165,13 @@ mapiodev(paddr_t addr, int _size) splx(s); if (error != 0) - return NULL; + return 0; va = uvm_km_valloc(kernel_map, size); if (va == 0) { extent_free(bs_extent, atop(pa), atop(size), EX_MALLOCOK | (cold ? 0 : EX_WAITSPACE)); - return NULL; + return 0; } iova = va + off; diff --git a/sys/arch/mvme88k/dev/vme.c b/sys/arch/mvme88k/dev/vme.c index 90841c91719..466d5ba4038 100644 --- a/sys/arch/mvme88k/dev/vme.c +++ b/sys/arch/mvme88k/dev/vme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vme.c,v 1.49 2009/02/17 21:03:21 miod Exp $ */ +/* $OpenBSD: vme.c,v 1.50 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. * Copyright (c) 1999 Steve Murphree, Jr. @@ -366,7 +366,7 @@ vmepmap(sc, vmeaddr, bustype) break; #endif default: - return NULL; + return 0; } return (base); } @@ -381,8 +381,8 @@ vmemap(struct vmesoftc *sc, off_t vmeaddr) paddr_t pa; pa = vmepmap((struct device *)sc, vmeaddr, BUS_VMES); - if (pa == NULL) - return (NULL); + if (pa == 0) + return (0); return mapiodev(pa, PAGE_SIZE); } @@ -422,7 +422,7 @@ vmerw(sc, uio, flags, bus) if (c == 0) return 0; vme = vmemap((struct vmesoftc *)sc, v & ~PGOFSET); - if (vme == NULL) + if (vme == 0) return EACCES; error = uiomove((void *)vme + (v & PGOFSET), c, uio); vmeunmap(vme); @@ -626,15 +626,15 @@ vme2chip_map(base, dwidth) case 16: if (base < VME2_D16STARTPHYS || base + PAGE_SIZE > VME2_D16ENDPHYS) - return NULL; + return 0; break; case 32: if (base < VME2_D32STARTPHYS || base + PAGE_SIZE > VME2_D32ENDPHYS) - return NULL; + return 0; break; default: - return NULL; + return 0; } return base; } diff --git a/sys/arch/mvme88k/dev/vmel.c b/sys/arch/mvme88k/dev/vmel.c index c7138828ceb..2516266d254 100644 --- a/sys/arch/mvme88k/dev/vmel.c +++ b/sys/arch/mvme88k/dev/vmel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmel.c,v 1.19 2010/12/26 15:40:59 miod Exp $ */ +/* $OpenBSD: vmel.c,v 1.20 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -164,7 +164,7 @@ vmelmmap(dev, off, prot) #ifdef DEBUG printf("vmel %llx pa %p\n", off, pa); #endif - if (pa == NULL) + if (pa == 0) return (-1); return (pa); } diff --git a/sys/arch/mvme88k/dev/vmes.c b/sys/arch/mvme88k/dev/vmes.c index 80bbe54b52c..431751c911f 100644 --- a/sys/arch/mvme88k/dev/vmes.c +++ b/sys/arch/mvme88k/dev/vmes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmes.c,v 1.22 2010/12/26 15:40:59 miod Exp $ */ +/* $OpenBSD: vmes.c,v 1.23 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -169,7 +169,7 @@ vmesmmap(dev, off, prot) #ifdef DEBUG printf("vmes %llx pa %p\n", off, pa); #endif - if (pa == NULL) + if (pa == 0) return (-1); return (pa); } diff --git a/sys/arch/mvme88k/dev/vx.c b/sys/arch/mvme88k/dev/vx.c index 6a8f1dc5abf..406b67abfd4 100644 --- a/sys/arch/mvme88k/dev/vx.c +++ b/sys/arch/mvme88k/dev/vx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vx.c,v 1.42 2010/06/28 14:13:29 deraadt Exp $ */ +/* $OpenBSD: vx.c,v 1.43 2011/04/07 15:30:15 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * All rights reserved. @@ -1133,10 +1133,10 @@ create_free_queue(struct vxsoftc *sc) for (i = 1; i <= NENVELOPES; i++) { bzero(&env, sizeof(struct envelope)); if (i == NENVELOPES) - env.link = NULL; + env.link = 0; else env.link = ENVELOPE_AREA + i * sizeof(struct envelope); - env.packet_ptr = NULL; + env.packet_ptr = 0; env.valid_flag = 0; d16_bcopy(&env, envp, sizeof(struct envelope)); envp++; @@ -1148,7 +1148,7 @@ create_free_queue(struct vxsoftc *sc) for (i = 1; i <= NPACKETS; i++) { bzero(&pkt, sizeof(struct packet)); if (i == NPACKETS) - pkt.link = NULL; + pkt.link = 0; else pkt.link = PACKET_AREA + i * sizeof(struct packet); d16_bcopy(&pkt, pktp, sizeof(struct packet)); diff --git a/sys/arch/sgi/dev/mkbc.c b/sys/arch/sgi/dev/mkbc.c index a4878ef000d..71576b9ca53 100644 --- a/sys/arch/sgi/dev/mkbc.c +++ b/sys/arch/sgi/dev/mkbc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkbc.c,v 1.10 2010/12/03 18:29:56 shadchin Exp $ */ +/* $OpenBSD: mkbc.c,v 1.11 2011/04/07 15:30:16 miod Exp $ */ /* * Copyright (c) 2006, 2007, Joel Sing @@ -267,8 +267,8 @@ mkbc_attach(struct device *parent, struct device *self, void *aux) t = malloc(sizeof(struct pckbc_internal), M_DEVBUF, M_WAITOK | M_ZERO); t->t_iot = msc->iot; - t->t_ioh_d = NULL; - t->t_ioh_c = NULL; + t->t_ioh_d = 0; + t->t_ioh_c = 0; t->t_addr = maa->maa_baseaddr; t->t_sc = (struct pckbc_softc *)msc; sc->id = t; diff --git a/sys/arch/sgi/sgi/sginode.c b/sys/arch/sgi/sgi/sginode.c index 2c3a450794b..0d5fe0cb4b6 100644 --- a/sys/arch/sgi/sgi/sginode.c +++ b/sys/arch/sgi/sgi/sginode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sginode.c,v 1.21 2011/04/03 22:34:54 miod Exp $ */ +/* $OpenBSD: sginode.c,v 1.22 2011/04/07 15:30:16 miod Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. * @@ -406,7 +406,7 @@ kl_scan_node(int nasid, uint clss, int (*cb)(lboard_t *, void *), void *cbarg) if ((*cb)(boardinfo, cbarg) != 0) return 1; } - if (boardinfo->brd_next == NULL) + if (boardinfo->brd_next == 0) break; } diff --git a/sys/arch/sparc/include/bus.h b/sys/arch/sparc/include/bus.h index cbf3f0f63f0..bd3999c5697 100644 --- a/sys/arch/sparc/include/bus.h +++ b/sys/arch/sparc/include/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.11 2011/03/23 16:54:37 pirofti Exp $ */ +/* $OpenBSD: bus.h,v 1.12 2011/04/07 15:30:16 miod Exp $ */ /* * Copyright (c) 2003, Miodrag Vallat. * @@ -90,8 +90,7 @@ static __inline__ int bus_space_map(bus_space_tag_t tag, bus_addr_t addr, bus_size_t size, int flags, bus_space_handle_t *handle) { - if ((*handle = (bus_space_handle_t)mapiodev(tag, - addr, size)) != NULL) + if ((*handle = (bus_space_handle_t)mapiodev(tag, addr, size)) != 0) return (0); return (ENOMEM); diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index 5b0239fa0cf..d0f7f23502d 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.131 2010/11/27 19:41:48 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.132 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */ /* @@ -831,7 +831,7 @@ mapdev(phys, virt, offset, size) static vaddr_t iobase; unsigned int pmtype; - if (iobase == NULL) + if (iobase == 0) iobase = IODEV_BASE; base = (paddr_t)phys->rr_paddr + offset; diff --git a/sys/arch/sparc/sparc/vm_machdep.c b/sys/arch/sparc/sparc/vm_machdep.c index 912be7ddf40..80b24f37955 100644 --- a/sys/arch/sparc/sparc/vm_machdep.c +++ b/sys/arch/sparc/sparc/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.53 2010/06/29 21:26:12 miod Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.54 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: vm_machdep.c,v 1.30 1997/03/10 23:55:40 pk Exp $ */ /* @@ -96,7 +96,7 @@ dvma_malloc_space(len, kaddr, flags, space) len = round_page(len); kva = (vaddr_t)malloc(len, M_DEVBUF, flags); - if (kva == NULL) + if (kva == 0) return (NULL); #if defined(SUN4M) @@ -106,7 +106,7 @@ dvma_malloc_space(len, kaddr, flags, space) *(vaddr_t *)kaddr = kva; dva = dvma_mapin_space(kernel_map, kva, len, (flags & M_NOWAIT) ? 0 : 1, space); - if (dva == NULL) { + if (dva == 0) { free((void *)kva, M_DEVBUF); return (NULL); } @@ -180,7 +180,7 @@ dvma_mapin_space(map, va, len, canwait, space) canwait ? EX_WAITSPACE : EX_NOWAIT, &tva); splx(s); if (error) - return NULL; + return 0; kva = tva; while (npf--) { diff --git a/sys/arch/sparc64/dev/fb.c b/sys/arch/sparc64/dev/fb.c index f823e887d4b..e947e23391c 100644 --- a/sys/arch/sparc64/dev/fb.c +++ b/sys/arch/sparc64/dev/fb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fb.c,v 1.22 2009/06/03 20:17:48 kettenis Exp $ */ +/* $OpenBSD: fb.c,v 1.23 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: fb.c,v 1.23 1997/07/07 23:30:22 pk Exp $ */ /* @@ -474,8 +474,8 @@ fb_get_console_metrics(int *fontwidth, int *fontheight, int *wtop, int *wleft) "addr window-top addr window-left", 4, &windowleft, &windowtop, &romwidth, &romheight); - if (romheight == NULL || romwidth == NULL || - windowtop == NULL || windowleft == NULL) + if (romheight == 0 || romwidth == 0 || + windowtop == 0 || windowleft == 0) return (1); *fontwidth = (int)*(uint64_t *)romwidth; diff --git a/sys/arch/sparc64/dev/fhc.c b/sys/arch/sparc64/dev/fhc.c index 1006bce15a5..46abed25a34 100644 --- a/sys/arch/sparc64/dev/fhc.c +++ b/sys/arch/sparc64/dev/fhc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fhc.c,v 1.17 2010/11/11 17:58:23 miod Exp $ */ +/* $OpenBSD: fhc.c,v 1.18 2011/04/07 15:30:16 miod Exp $ */ /* * Copyright (c) 2004 Jason L. Wright (jason@thought.net) @@ -121,7 +121,7 @@ fhc_attach(struct fhc_softc *sc) free(fa.fa_name, M_DEVBUF); if (fa.fa_reg != NULL) free(fa.fa_reg, M_DEVBUF); - if (fa.fa_nintr != NULL) + if (fa.fa_intr != NULL) free(fa.fa_intr, M_DEVBUF); if (fa.fa_promvaddrs != NULL) free(fa.fa_promvaddrs, M_DEVBUF); diff --git a/sys/arch/sparc64/dev/iommu.c b/sys/arch/sparc64/dev/iommu.c index a0a1baae8ac..52837d17d0b 100644 --- a/sys/arch/sparc64/dev/iommu.c +++ b/sys/arch/sparc64/dev/iommu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iommu.c,v 1.62 2010/04/20 23:26:59 deraadt Exp $ */ +/* $OpenBSD: iommu.c,v 1.63 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: iommu.c,v 1.47 2002/02/08 20:03:45 eeh Exp $ */ /* @@ -1076,7 +1076,7 @@ iommu_dvmamap_append_range(bus_dma_tag_t t, bus_dmamap_t map, paddr_t pa, sgend = sgstart + length - 1; #ifdef DIAGNOSTIC - if (sgstart == NULL || sgstart > sgend) { + if (sgstart == 0 || sgstart > sgend) { printf("append range invalid mapping for %lx " "(0x%llx - 0x%llx)\n", pa, sgstart, sgend); map->dm_nsegs = 0; @@ -1699,7 +1699,7 @@ iommu_iomap_insert_page(struct iommu_map_state *ims, paddr_t pa) e = &ipm->ipm_map[ipm->ipm_pagecnt]; e->ipe_pa = pa; - e->ipe_va = NULL; + e->ipe_va = 0; e = SPLAY_INSERT(iommu_page_tree, &ipm->ipm_tree, e); @@ -1787,7 +1787,7 @@ iommu_iomap_translate(struct iommu_map_state *ims, paddr_t pa) e = SPLAY_FIND(iommu_page_tree, &ipm->ipm_tree, &pe); if (e == NULL) - return (NULL); + return (0); return (e->ipe_va | offset); } diff --git a/sys/arch/sparc64/dev/uperf.c b/sys/arch/sparc64/dev/uperf.c index 5989ea93105..5a079862d61 100644 --- a/sys/arch/sparc64/dev/uperf.c +++ b/sys/arch/sparc64/dev/uperf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uperf.c,v 1.5 2003/06/02 20:02:49 jason Exp $ */ +/* $OpenBSD: uperf.c,v 1.6 2011/04/07 15:30:16 miod Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -146,7 +146,7 @@ uperf_findbyval(usc, cnt, uval, rval) { struct uperf_src *srcs = usc->usc_srcs; - if (srcs->us_src == NULL) + if (srcs->us_src == 0) return (EINVAL); while (srcs->us_src != -1) { @@ -191,7 +191,7 @@ uperf_findbysrc(usc, cnt, src, rval) { struct uperf_src *srcs = usc->usc_srcs; - if (srcs->us_src == NULL) + if (srcs->us_src == 0) return (EINVAL); while (srcs->us_src != -1) { diff --git a/sys/arch/sparc64/dev/viommu.c b/sys/arch/sparc64/dev/viommu.c index af8797f4cb5..41d5260931e 100644 --- a/sys/arch/sparc64/dev/viommu.c +++ b/sys/arch/sparc64/dev/viommu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: viommu.c,v 1.10 2010/08/07 03:50:01 krw Exp $ */ +/* $OpenBSD: viommu.c,v 1.11 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: iommu.c,v 1.47 2002/02/08 20:03:45 eeh Exp $ */ /* @@ -614,7 +614,7 @@ viommu_dvmamap_append_range(bus_dma_tag_t t, bus_dmamap_t map, paddr_t pa, sgend = sgstart + length - 1; #ifdef DIAGNOSTIC - if (sgstart == NULL || sgstart > sgend) { + if (sgstart == 0 || sgstart > sgend) { printf("append range invalid mapping for %lx " "(0x%llx - 0x%llx)\n", pa, sgstart, sgend); map->dm_nsegs = 0; diff --git a/sys/arch/sparc64/sparc64/autoconf.c b/sys/arch/sparc64/sparc64/autoconf.c index ebcaff14048..af4b2326d49 100644 --- a/sys/arch/sparc64/sparc64/autoconf.c +++ b/sys/arch/sparc64/sparc64/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.109 2010/11/18 21:13:19 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.110 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: autoconf.c,v 1.51 2001/07/24 19:32:11 eeh Exp $ */ /* @@ -1219,7 +1219,7 @@ int romgetcursoraddr(rowp, colp) int **rowp, **colp; { - cell_t row = NULL, col = NULL; + cell_t row = 0, col = 0; OF_interpret("stdout @ is my-self addr line# addr column# ", 2, &col, &row); @@ -1229,7 +1229,7 @@ romgetcursoraddr(rowp, colp) * 64-bit values. To convert them to pointers to interfaces, add * 4 to the address. */ - if (row == NULL || col == NULL) + if (row == 0 || col == 0) return (-1); *rowp = (int *)(row + 4); *colp = (int *)(col + 4); diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index 1e0bfa84b9f..29aa600588f 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.128 2011/03/05 17:48:59 deraadt Exp $ */ +/* $OpenBSD: machdep.c,v 1.129 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */ /*- @@ -353,7 +353,7 @@ setregs(p, pack, stack, retval) tf->tf_global[2] = tf->tf_global[7] = tf->tf_pc; stack -= sizeof(struct rwindow); tf->tf_out[6] = stack - STACK_OFFSET; - tf->tf_out[7] = NULL; + tf->tf_out[7] = 0; #ifdef NOTDEF_DEBUG printf("setregs: setting tf %p sp %p pc %p\n", (long)tf, (long)tf->tf_out[6], (long)tf->tf_pc); @@ -1808,7 +1808,7 @@ sparc_bus_mmap(bus_space_tag_t t, bus_space_tag_t t0, bus_addr_t paddr, { if (PHYS_ASI(t0->asi)) { printf("\nsparc_bus_mmap: physical ASI"); - return (NULL); + return (0); } /* Devices are un-cached... although the driver should do that */ diff --git a/sys/arch/sparc64/sparc64/pmap.c b/sys/arch/sparc64/sparc64/pmap.c index 4aefe5525fe..35099d8bcfe 100644 --- a/sys/arch/sparc64/sparc64/pmap.c +++ b/sys/arch/sparc64/sparc64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.71 2010/11/20 20:33:24 miod Exp $ */ +/* $OpenBSD: pmap.c,v 1.72 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: pmap.c,v 1.107 2001/08/31 16:47:41 eeh Exp $ */ #undef NO_VCACHE /* Don't forget the locked TLB in dostart */ /* @@ -461,9 +461,9 @@ pmap_enter_kpage(vaddr_t va, int64_t data) { paddr_t newp; - newp = NULL; + newp = 0; while (pseg_set(pmap_kernel(), va, data, newp) == 1) { - newp = NULL; + newp = 0; if (!pmap_get_page(&newp, NULL, pmap_kernel())) { prom_printf("pmap_enter_kpage: out of pages\n"); panic("pmap_enter_kpage"); @@ -1748,11 +1748,11 @@ pmap_release(pm) pa); } } - stxa(pdirentp, ASI_PHYS_CACHED, NULL); + stxa(pdirentp, ASI_PHYS_CACHED, 0); pmap_free_page((paddr_t)ptbl, pm); } } - stxa(psegentp, ASI_PHYS_CACHED, NULL); + stxa(psegentp, ASI_PHYS_CACHED, 0); pmap_free_page((paddr_t)pdir, pm); } } @@ -1836,14 +1836,14 @@ pmap_collect(pm) } if (!n) { /* Free the damn thing */ - stxa((paddr_t)(u_long)&pdir[k], ASI_PHYS_CACHED, NULL); + stxa((paddr_t)(u_long)&pdir[k], ASI_PHYS_CACHED, 0); pmap_free_page((paddr_t)ptbl, pm); } } } if (!m) { /* Free the damn thing */ - stxa((paddr_t)(u_long)&pm->pm_segs[i], ASI_PHYS_CACHED, NULL); + stxa((paddr_t)(u_long)&pm->pm_segs[i], ASI_PHYS_CACHED, 0); pmap_free_page((paddr_t)pdir, pm); } } @@ -1890,7 +1890,7 @@ pmap_activate(p) s = splvm(); if (p == curproc) { write_user_windows(); - if (pmap->pm_ctx == NULL) + if (pmap->pm_ctx == 0) ctx_alloc(pmap); if (CPU_ISSUN4V) stxa(CTX_SECONDARY, ASI_MMU_CONTEXTID, pmap->pm_ctx); @@ -2153,9 +2153,9 @@ pmap_enter(pm, va, pa, prot, flags) } KDASSERT((tte.data & TLB_NFO) == 0); - pg = NULL; + pg = 0; while (pseg_set(pm, va, tte.data, pg) == 1) { - pg = NULL; + pg = 0; if (!pmap_get_page(&pg, NULL, pm)) { if ((flags & PMAP_CANFAIL) == 0) panic("pmap_enter: no memory"); @@ -3211,7 +3211,7 @@ ctx_alloc(pm) */ if (cnum >= numctx - 2) cnum = 0; - } while (ctxbusy[++cnum] != NULL && cnum != next); + } while (ctxbusy[++cnum] != 0 && cnum != next); if (cnum==0) cnum++; /* Never steal ctx 0 */ if (ctxbusy[cnum]) { int i; @@ -3271,7 +3271,7 @@ ctx_free(pm) Debugger(); } #endif - ctxbusy[oldctx] = NULL; + ctxbusy[oldctx] = 0; } /* diff --git a/sys/arch/vax/mbus/mbus.c b/sys/arch/vax/mbus/mbus.c index 5a4aad494fb..7663aab4235 100644 --- a/sys/arch/vax/mbus/mbus.c +++ b/sys/arch/vax/mbus/mbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mbus.c,v 1.3 2010/09/20 06:33:48 matthew Exp $ */ +/* $OpenBSD: mbus.c,v 1.4 2011/04/07 15:30:16 miod Exp $ */ /* * Copyright (c) 2008 Miodrag Vallat. @@ -126,7 +126,7 @@ mbus_attach(struct device *parent, struct device *self, void *aux) pa = MBUS_SLOT_BASE(mid); fbic = vax_map_physmem(pa + FBIC_BASE, 1); - if (fbic == NULL) + if (fbic == 0) panic("unable to map slot %d registers", mid); if (badaddr((caddr_t)(fbic + FBIC_MODTYPE), 4) != 0) @@ -170,7 +170,7 @@ mbus_attach(struct device *parent, struct device *self, void *aux) ms->ms_fbic[1].regs = ms->ms_fbic[0].regs; ms->ms_nfbic = 2; fbic = vax_map_physmem(pa + FBIC_CPUA_BASE, 1); - if (fbic == NULL) + if (fbic == 0) panic("unable to map slot %d registers", mid); ms->ms_fbic[0].base = pa + FBIC_CPUA_BASE; ms->ms_fbic[0].regs = fbic; diff --git a/sys/arch/vax/mbus/uba_mbus.c b/sys/arch/vax/mbus/uba_mbus.c index ed78ffdcf2b..da1b9013b1b 100644 --- a/sys/arch/vax/mbus/uba_mbus.c +++ b/sys/arch/vax/mbus/uba_mbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uba_mbus.c,v 1.1 2008/08/18 23:19:25 miod Exp $ */ +/* $OpenBSD: uba_mbus.c,v 1.2 2011/04/07 15:30:16 miod Exp $ */ /* * Copyright (c) 2008 Miodrag Vallat. @@ -115,7 +115,7 @@ uba_mbus_attach(struct device *parent, struct device *self, void *aux) */ modaddr = MBUS_SLOT_BASE(maa->maa_mid); fbic = vax_map_physmem(modaddr + FBIC_BASE, 1); - if (fbic == NULL) { + if (fbic == 0) { printf("%s: can't setup M-bus range register\n"); return; } diff --git a/sys/arch/vax/vsa/lcg.c b/sys/arch/vax/vsa/lcg.c index a714b10edae..529c577b230 100644 --- a/sys/arch/vax/vsa/lcg.c +++ b/sys/arch/vax/vsa/lcg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lcg.c,v 1.15 2010/12/26 15:41:00 miod Exp $ */ +/* $OpenBSD: lcg.c,v 1.16 2011/04/07 15:30:16 miod Exp $ */ /* * Copyright (c) 2006 Miodrag Vallat. * @@ -235,7 +235,7 @@ lcg_attach(struct device *parent, struct device *self, void *aux) */ if (!console) { tmp = vax_map_physmem(LCG_CONFIG_ADDR, 1); - if (tmp == NULL) { + if (tmp == 0) { printf("\n%s: can not map configuration register\n", self->dv_xname); return; diff --git a/sys/dev/diskmap.c b/sys/dev/diskmap.c index 3a005e8550a..a080dc24c29 100644 --- a/sys/dev/diskmap.c +++ b/sys/dev/diskmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskmap.c,v 1.3 2011/01/12 23:18:56 thib Exp $ */ +/* $OpenBSD: diskmap.c,v 1.4 2011/04/07 15:30:16 miod Exp $ */ /* * Copyright (c) 2009, 2010 Joel Sing <jsing@openbsd.org> @@ -86,7 +86,7 @@ diskmapioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) goto bad; } - if (FILE_IS_USABLE(fp) == NULL) { + if (!FILE_IS_USABLE(fp)) { error = EINVAL; goto bad; } diff --git a/sys/dev/ic/adw.c b/sys/dev/ic/adw.c index 3b4aee4597e..c002dbcfae8 100644 --- a/sys/dev/ic/adw.c +++ b/sys/dev/ic/adw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adw.c,v 1.48 2010/10/03 21:23:35 krw Exp $ */ +/* $OpenBSD: adw.c,v 1.49 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: adw.c,v 1.23 2000/05/27 18:24:50 dante Exp $ */ /* @@ -748,7 +748,7 @@ adw_build_sglist(ccb, scsiqp, sg_block) if (--sg_elem_cnt == 0) { /* last entry, get out */ sg_block->sg_cnt = i + 1; - sg_block->sg_ptr = NULL; /* next link = NULL */ + sg_block->sg_ptr = 0; /* next link = NULL */ return; } sg_list++; diff --git a/sys/dev/ic/adwlib.c b/sys/dev/ic/adwlib.c index 92daf2b5eff..b85f85f560c 100644 --- a/sys/dev/ic/adwlib.c +++ b/sys/dev/ic/adwlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adwlib.c,v 1.22 2010/07/02 03:24:50 tedu Exp $ */ +/* $OpenBSD: adwlib.c,v 1.23 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: adwlib.c,v 1.20 2000/07/04 04:17:03 itojun Exp $ */ /* @@ -2078,7 +2078,7 @@ ADW_SOFTC *sc; free_carrp = sc->irq_sp; sc->irq_sp = ADW_CARRIER_VADDR(sc, ADW_GET_CARRP(irq_next_pa)); - free_carrp->next_ba = (sc->carr_freelist == NULL) ? NULL + free_carrp->next_ba = (sc->carr_freelist == NULL) ? 0 : sc->carr_freelist->carr_ba; sc->carr_freelist = free_carrp; sc->carr_pending_cnt--; diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c index 8abe227fc22..9a55d7a5868 100644 --- a/sys/dev/ic/fxp.c +++ b/sys/dev/ic/fxp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fxp.c,v 1.107 2010/09/07 16:21:42 deraadt Exp $ */ +/* $OpenBSD: fxp.c,v 1.108 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */ /* @@ -1832,7 +1832,7 @@ fxp_load_ucode(struct fxp_softc *sc) for (uc = ucode_table; uc->revision != 0; uc++) if (sc->sc_revision == uc->revision) break; - if (uc->revision == NULL) + if (uc->revision == 0) return; /* no ucode for this chip is found */ error = loadfirmware(uc->uname, (u_char **)&ucode_buf, &ucode_len); diff --git a/sys/dev/ic/sti.c b/sys/dev/ic/sti.c index c4f292ec311..7bbdaeaa06c 100644 --- a/sys/dev/ic/sti.c +++ b/sys/dev/ic/sti.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sti.c,v 1.61 2009/09/05 14:09:35 miod Exp $ */ +/* $OpenBSD: sti.c,v 1.62 2011/04/07 15:30:16 miod Exp $ */ /* * Copyright (c) 2000-2003 Michael Shalayeff @@ -349,7 +349,7 @@ sti_rom_setup(struct sti_rom *rom, bus_space_tag_t iot, bus_space_tag_t memt, */ #define O(i) \ - (dd->dd_pacode[(i)] == 0 ? NULL : \ + (dd->dd_pacode[(i)] == 0 ? 0 : \ (rom->rom_code + (dd->dd_pacode[(i)] - dd->dd_pacode[0]) / \ (rom->rom_devtype == STI_DEVTYPE1? 4 : 1))) diff --git a/sys/dev/isa/isapnp.c b/sys/dev/isa/isapnp.c index 0b1094388e5..5e5d8a7b674 100644 --- a/sys/dev/isa/isapnp.c +++ b/sys/dev/isa/isapnp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isapnp.c,v 1.38 2011/04/05 19:54:35 jasper Exp $ */ +/* $OpenBSD: isapnp.c,v 1.39 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: isapnp.c,v 1.9.4.3 1997/10/29 00:40:43 thorpej Exp $ */ /* @@ -200,7 +200,7 @@ isapnp_free_region(t, r) return; bus_space_unmap(t, r->h, r->length); - r->h = NULL; + r->h = 0; } @@ -217,7 +217,7 @@ isapnp_alloc_region(t, r) if (r->length == 0) return 0; - r->h = NULL; + r->h = 0; for (r->base = r->minbase; r->base <= r->maxbase; r->base += r->align) { error = bus_space_map(t, r->base, r->length, 0, &r->h); diff --git a/sys/dev/microcode/adw/adwmcode.c b/sys/dev/microcode/adw/adwmcode.c index 41818b8ff59..7045fb46204 100644 --- a/sys/dev/microcode/adw/adwmcode.c +++ b/sys/dev/microcode/adw/adwmcode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adwmcode.c,v 1.4 2010/06/26 23:24:45 guenther Exp $ */ +/* $OpenBSD: adwmcode.c,v 1.5 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: adwmcode.c,v 1.5 2000/05/27 18:24:50 dante Exp $ */ /* @@ -77,7 +77,7 @@ AdwInitCarriers(carr_dmap, carriers) ADW_CARRIER *carriers; { ADW_CARRIER *carr; - u_int32_t carr_next = NULL; + u_int32_t carr_next = 0; int i; bzero(carriers, sizeof(ADW_CARRIER) * ADW_MAX_CARRIER); diff --git a/sys/dev/mii/ipgphy.c b/sys/dev/mii/ipgphy.c index 309a7651823..e1c0f724177 100644 --- a/sys/dev/mii/ipgphy.c +++ b/sys/dev/mii/ipgphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipgphy.c,v 1.13 2010/02/03 16:22:58 sthen Exp $ */ +/* $OpenBSD: ipgphy.c,v 1.14 2011/04/07 15:30:16 miod Exp $ */ /*- * Copyright (c) 2006, Pyun YongHyeon <yongari@FreeBSD.org> @@ -84,7 +84,7 @@ static const struct mii_phydesc ipgphys[] = { MII_STR_ICPLUS_IP1001 }, { 0, - NULL }, + 0 }, }; int diff --git a/sys/dev/pci/ahci.c b/sys/dev/pci/ahci.c index ffe4e968d28..299b387a026 100644 --- a/sys/dev/pci/ahci.c +++ b/sys/dev/pci/ahci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ahci.c,v 1.173 2011/04/03 17:04:19 krw Exp $ */ +/* $OpenBSD: ahci.c,v 1.174 2011/04/07 15:30:16 miod Exp $ */ /* * Copyright (c) 2006 David Gwynne <dlg@openbsd.org> @@ -2475,7 +2475,7 @@ ahci_issue_pending_ncq_commands(struct ahci_port *ap) * If a port multiplier is attached to the port, we can only * issue commands for one of its ports at a time. */ - if (ap->ap_sactive != NULL && + if (ap->ap_sactive != 0 && ap->ap_pmp_ncq_port != nextccb->ccb_xa.pmp_port) { return; } diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c index c7977adade7..6a8b7d19c64 100644 --- a/sys/dev/pci/drm/drm_drv.c +++ b/sys/dev/pci/drm/drm_drv.c @@ -179,7 +179,7 @@ drm_attach(struct device *parent, struct device *self, void *aux) * conflict with it. */ dev->handle_ext = extent_create("drmext", 1024*1024*1024, LONG_MAX, - M_DRM, NULL, NULL, EX_NOWAIT | EX_NOCOALESCE); + M_DRM, NULL, 0, EX_NOWAIT | EX_NOCOALESCE); if (dev->handle_ext == NULL) { DRM_ERROR("Failed to initialise handle extent\n"); goto error; diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c index 29ccafed6d8..8eb0cdf200f 100644 --- a/sys/dev/pci/drm/i915_drv.c +++ b/sys/dev/pci/drm/i915_drv.c @@ -528,7 +528,7 @@ inteldrm_detach(struct device *self, int flags) dev_priv->hw_status_page = NULL; } - if (IS_I9XX(dev_priv) && dev_priv->ifp.i9xx.bsh != NULL) { + if (IS_I9XX(dev_priv) && dev_priv->ifp.i9xx.bsh != 0) { bus_space_unmap(dev_priv->ifp.i9xx.bst, dev_priv->ifp.i9xx.bsh, PAGE_SIZE); } else if (dev_priv->flags & (CHIP_I830 | CHIP_I845G | CHIP_I85X | @@ -944,7 +944,7 @@ i915_alloc_ifp(struct inteldrm_softc *dev_priv, struct pci_attach_args *bpa) return; nope: - dev_priv->ifp.i9xx.bsh = NULL; + dev_priv->ifp.i9xx.bsh = 0; printf(": no ifp "); } @@ -979,7 +979,7 @@ i965_alloc_ifp(struct inteldrm_softc *dev_priv, struct pci_attach_args *bpa) return; nope: - dev_priv->ifp.i9xx.bsh = NULL; + dev_priv->ifp.i9xx.bsh = 0; printf(": no ifp "); } @@ -991,7 +991,7 @@ inteldrm_chipset_flush(struct inteldrm_softc *dev_priv) * The write will return when it is done. */ if (IS_I9XX(dev_priv)) { - if (dev_priv->ifp.i9xx.bsh != NULL) + if (dev_priv->ifp.i9xx.bsh != 0) bus_space_write_4(dev_priv->ifp.i9xx.bst, dev_priv->ifp.i9xx.bsh, 0, 1); } else { diff --git a/sys/dev/pci/if_em_soc.c b/sys/dev/pci/if_em_soc.c index 7932e9cacd2..73b438f42c9 100644 --- a/sys/dev/pci/if_em_soc.c +++ b/sys/dev/pci/if_em_soc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_em_soc.c,v 1.1 2009/11/25 13:28:13 dms Exp $ */ +/* $OpenBSD: if_em_soc.c,v 1.2 2011/04/07 15:30:16 miod Exp $ */ /* * Copyright (c) 2009 Dariusz Swiderski <sfires@sfires.net> @@ -32,7 +32,7 @@ em_lookup_gcu(struct device *self) INIT_DEBUGOUT("em_lookup_gcu"); TAILQ_FOREACH(dev, &alldevs, dv_list) { - if (strcmp(dev->dv_xname, "gcu0") == NULL) { + if (strcmp(dev->dv_xname, "gcu0") == 0) { return dev; } } diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index 368a447645f..cf2c4dea18d 100644 --- a/sys/dev/pci/if_ipw.c +++ b/sys/dev/pci/if_ipw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ipw.c,v 1.94 2010/11/15 19:11:57 damien Exp $ */ +/* $OpenBSD: if_ipw.c,v 1.95 2011/04/07 15:30:16 miod Exp $ */ /*- * Copyright (c) 2004-2008 @@ -1997,7 +1997,7 @@ ipw_init(struct ifnet *ifp) goto fail1; } - if ((error = ipw_read_firmware(sc, &fw)) != NULL) { + if ((error = ipw_read_firmware(sc, &fw)) != 0) { printf("%s: error %d, could not read firmware\n", sc->sc_dev.dv_xname, error); goto fail1; diff --git a/sys/dev/pci/if_ix.c b/sys/dev/pci/if_ix.c index 7736df5cfb2..5ce67675bee 100644 --- a/sys/dev/pci/if_ix.c +++ b/sys/dev/pci/if_ix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ix.c,v 1.48 2011/04/05 18:01:21 henning Exp $ */ +/* $OpenBSD: if_ix.c,v 1.49 2011/04/07 15:30:16 miod Exp $ */ /****************************************************************************** @@ -1375,9 +1375,9 @@ ixgbe_free_pci_resources(struct ix_softc * sc) if (sc->tag[0]) pci_intr_disestablish(pa->pa_pc, sc->tag[0]); sc->tag[0] = NULL; - if (os->os_membase != NULL) + if (os->os_membase != 0) bus_space_unmap(os->os_memt, os->os_memh, os->os_memsize); - os->os_membase = NULL; + os->os_membase = 0; return; } diff --git a/sys/dev/pci/pcscp.c b/sys/dev/pci/pcscp.c index fc496d92e6f..76ac7900300 100644 --- a/sys/dev/pci/pcscp.c +++ b/sys/dev/pci/pcscp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcscp.c,v 1.17 2010/06/28 18:31:02 krw Exp $ */ +/* $OpenBSD: pcscp.c,v 1.18 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: pcscp.c,v 1.26 2003/10/19 10:25:42 tsutsui Exp $ */ /*- @@ -171,7 +171,7 @@ pcscp_attach(struct device *parent, struct device *self, void *aux) int error, rseg; if (pci_mapreg_map(pa, IO_MAP_REG, PCI_MAPREG_TYPE_IO, 0, - &iot, &ioh, NULL, NULL, NULL)) { + &iot, &ioh, NULL, NULL, 0)) { printf("%s: unable to map registers\n", sc->sc_dev.dv_xname); return; } diff --git a/sys/dev/pci/tga.c b/sys/dev/pci/tga.c index 5c8aa4ef742..4ad9b192eb3 100644 --- a/sys/dev/pci/tga.c +++ b/sys/dev/pci/tga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tga.c,v 1.35 2010/12/26 15:41:00 miod Exp $ */ +/* $OpenBSD: tga.c,v 1.36 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: tga.c,v 1.40 2002/03/13 15:05:18 ad Exp $ */ /* @@ -430,7 +430,7 @@ tgaattach(parent, self, aux) tga_getdevconfig(pa->pa_memt, pa->pa_pc, pa->pa_tag, sc->sc_dc); } - if (sc->sc_dc->dc_vaddr == NULL) { + if (sc->sc_dc->dc_vaddr == 0) { printf(": can't map mem space\n"); return; } @@ -784,7 +784,7 @@ tga_cnattach(iot, memt, pc, bus, device, function) pci_make_tag(pc, bus, device, function), dcp); /* sanity checks */ - if (dcp->dc_vaddr == NULL) + if (dcp->dc_vaddr == 0) panic("tga_console(%d, %d): can't map mem space", device, function); if (dcp->dc_tgaconf == NULL) diff --git a/sys/dev/pcmcia/if_malo.c b/sys/dev/pcmcia/if_malo.c index b4d4c400aa8..23c5afa3121 100644 --- a/sys/dev/pcmcia/if_malo.c +++ b/sys/dev/pcmcia/if_malo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_malo.c,v 1.71 2010/08/30 20:33:18 deraadt Exp $ */ +/* $OpenBSD: if_malo.c,v 1.72 2011/04/07 15:30:16 miod Exp $ */ /* * Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org> @@ -205,7 +205,7 @@ malo_pcmcia_attach(struct device *parent, struct device *self, void *aux) } intrstr = pcmcia_intr_string(psc->sc_pf, psc->sc_ih); if (intrstr != NULL) { - if (*intrstr != NULL) + if (*intrstr != '\0') printf(", %s", intrstr); } printf("\n"); diff --git a/sys/dev/usb/hidms.c b/sys/dev/usb/hidms.c index a24368a8744..261a56514c4 100644 --- a/sys/dev/usb/hidms.c +++ b/sys/dev/usb/hidms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hidms.c,v 1.2 2011/03/04 23:57:52 kettenis Exp $ */ +/* $OpenBSD: hidms.c,v 1.3 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: ums.c,v 1.60 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -188,7 +188,7 @@ hidms_setup(struct device *self, struct hidms *ms, uint32_t quirks, /* figure out the number of buttons */ for (i = 1; i <= MAX_BUTTONS; i++) if (!hid_locate(desc, dlen, HID_USAGE2(HUP_BUTTON, i), id, - hid_input, &ms->sc_loc_btn[i - 1], 0)) + hid_input, &ms->sc_loc_btn[i - 1], NULL)) break; ms->sc_num_buttons = i - 1; diff --git a/sys/dev/usb/if_uath.c b/sys/dev/usb/if_uath.c index cd79e4d327d..cb75a93a3a7 100644 --- a/sys/dev/usb/if_uath.c +++ b/sys/dev/usb/if_uath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_uath.c,v 1.49 2011/01/25 20:03:35 jakemsr Exp $ */ +/* $OpenBSD: if_uath.c,v 1.50 2011/04/07 15:30:16 miod Exp $ */ /*- * Copyright (c) 2006 @@ -1906,7 +1906,7 @@ uath_init(struct ifnet *ifp) } } - error = uath_cmd_read(sc, UATH_CMD_07, 0, NULL, &val, + error = uath_cmd_read(sc, UATH_CMD_07, NULL, 0, &val, UATH_CMD_FLAG_MAGIC); if (error != 0) { printf("%s: could not send read command 07h\n", diff --git a/sys/dev/usb/uhts.c b/sys/dev/usb/uhts.c index 318ac3a4448..c38c56f56b4 100644 --- a/sys/dev/usb/uhts.c +++ b/sys/dev/usb/uhts.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhts.c,v 1.2 2011/03/03 21:48:49 kettenis Exp $ */ +/* $OpenBSD: uhts.c,v 1.3 2011/04/07 15:30:16 miod Exp $ */ /* * Copyright (c) 2009 Matthieu Herrb <matthieu@herrb.eu> * Copyright (c) 2007 Robert Nagy <robert@openbsd.org> @@ -211,7 +211,7 @@ uhts_attach(struct device *parent, struct device *self, void *aux) } if (!hid_locate(desc, size, HID_USAGE2(HUP_DIGITIZERS, HUD_TIP_SWITCH), uha->reportid, hid_input, - &sc->sc_loc_btn, 0)){ + &sc->sc_loc_btn, NULL)){ printf("\n%s: touch screen has no button\n", sc->sc_hdev.sc_dev.dv_xname); return; diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 52b6ae53835..f09be212496 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsock.c,v 1.117 2011/04/04 20:25:35 blambert Exp $ */ +/* $OpenBSD: rtsock.c,v 1.118 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */ /* @@ -533,7 +533,7 @@ route_output(struct mbuf *m, ...) tableid = rtm->rtm_tableid; if (!rtable_exists(tableid)) { if (rtm->rtm_type == RTM_ADD) { - if ((error = rtable_add(tableid)) != NULL) + if ((error = rtable_add(tableid)) != 0) goto flush; } else { error = EINVAL; diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 79f734fb3e3..e2832edb209 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.223 2011/04/07 00:05:18 krw Exp $ */ +/* $OpenBSD: sd.c,v 1.224 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -737,7 +737,7 @@ sdstart(struct scsi_xfer *xs) /* move onto the next io */ if (ISSET(sc->flags, SDF_WAITING)) CLR(sc->flags, SDF_WAITING); - else if (bufq_peek(&sc->sc_bufq) != NULL) + else if (bufq_peek(&sc->sc_bufq)) scsi_xsh_add(&sc->sc_xsh); } diff --git a/sys/uvm/uvm_km.c b/sys/uvm/uvm_km.c index 759feace21f..0a93cd2c91e 100644 --- a/sys/uvm/uvm_km.c +++ b/sys/uvm/uvm_km.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_km.c,v 1.93 2011/04/06 15:52:13 art Exp $ */ +/* $OpenBSD: uvm_km.c,v 1.94 2011/04/07 15:30:16 miod Exp $ */ /* $NetBSD: uvm_km.c,v 1.42 2001/01/14 02:10:01 thorpej Exp $ */ /* @@ -548,7 +548,7 @@ uvm_km_alloc1(struct vm_map *map, vsize_t size, vsize_t align, boolean_t zeroit) * allocated and fail. */ uvm_unmap(map, kva, loopva - kva); - return (NULL); + return (0); } else { uvm_wait("km_alloc1w"); /* wait for memory */ continue; @@ -737,12 +737,12 @@ uvm_km_page_init(void) for (i = 0; i < uvm_km_pages.hiwat; i++) { uvm_km_pages.page[i] = (vaddr_t)uvm_km_kmemalloc(kernel_map, NULL, PAGE_SIZE, UVM_KMF_NOWAIT|UVM_KMF_VALLOC); - if (uvm_km_pages.page[i] == NULL) + if (uvm_km_pages.page[i] == 0) break; } uvm_km_pages.free = i; for ( ; i < UVM_KM_PAGES_HIWAT_MAX; i++) - uvm_km_pages.page[i] = NULL; + uvm_km_pages.page[i] = 0; /* tone down if really high */ if (uvm_km_pages.lowat > 512) |