summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2011-04-07 15:30:17 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2011-04-07 15:30:17 +0000
commit470f59fa3f11b7317fc5907cfef6043f2104bcc6 (patch)
tree50aedec19587d2927b807e6719da0022055c56df /sys/arch/sparc64
parent1d2ed5cc87538f3c2a6389c586a609a8b73610b7 (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/sparc64')
-rw-r--r--sys/arch/sparc64/dev/fb.c6
-rw-r--r--sys/arch/sparc64/dev/fhc.c4
-rw-r--r--sys/arch/sparc64/dev/iommu.c8
-rw-r--r--sys/arch/sparc64/dev/uperf.c6
-rw-r--r--sys/arch/sparc64/dev/viommu.c4
-rw-r--r--sys/arch/sparc64/sparc64/autoconf.c6
-rw-r--r--sys/arch/sparc64/sparc64/machdep.c6
-rw-r--r--sys/arch/sparc64/sparc64/pmap.c24
8 files changed, 32 insertions, 32 deletions
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;
}
/*