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 /sys/arch/sparc | |
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@
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r-- | sys/arch/sparc/include/bus.h | 5 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/vm_machdep.c | 8 |
3 files changed, 8 insertions, 9 deletions
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--) { |