summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2020-04-11 00:05:31 +0300
committerToomas Soome <tsoome@me.com>2020-04-24 21:03:27 +0300
commit12551037071c8ef2216bb540edd94a5bff5e90ae (patch)
tree952bbc44a4a8d7a8c077fb181bba89e79b62177b
parent13c31a0ee516ab913296f7367d3c09a79ff3ba21 (diff)
downloadillumos-joyent-12551037071c8ef2216bb540edd94a5bff5e90ae.tar.gz
12532 unix: NULL pointer errors
Reviewed by: Gary Mills <gary_mills@fastmail.fm> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/uts/sfmmu/vm/hat_sfmmu.c6
-rw-r--r--usr/src/uts/sparc/fs/proc/prmachdep.c6
-rw-r--r--usr/src/uts/sparc/syscall/getcontext.c10
-rw-r--r--usr/src/uts/sparc/v9/os/v9dep.c13
-rw-r--r--usr/src/uts/sun4/io/ivintr.c2
-rw-r--r--usr/src/uts/sun4/os/machdep.c2
-rw-r--r--usr/src/uts/sun4/os/mlsetup.c2
-rw-r--r--usr/src/uts/sun4/os/mp_states.c4
-rw-r--r--usr/src/uts/sun4/os/x_call.c19
-rw-r--r--usr/src/uts/sun4u/os/fillsysinfo.c2
-rw-r--r--usr/src/uts/sun4u/os/mach_cpu_states.c4
-rw-r--r--usr/src/uts/sun4v/os/intrq.c12
-rw-r--r--usr/src/uts/sun4v/os/mach_cpu_states.c8
-rw-r--r--usr/src/uts/sun4v/os/mach_startup.c8
-rw-r--r--usr/src/uts/sun4v/os/mpo.c10
-rw-r--r--usr/src/uts/sun4v/os/suspend.c2
-rw-r--r--usr/src/uts/sun4v/vm/mach_sfmmu.c2
17 files changed, 56 insertions, 56 deletions
diff --git a/usr/src/uts/sfmmu/vm/hat_sfmmu.c b/usr/src/uts/sfmmu/vm/hat_sfmmu.c
index 13e6a1cdfe..2c6f5fb87f 100644
--- a/usr/src/uts/sfmmu/vm/hat_sfmmu.c
+++ b/usr/src/uts/sfmmu/vm/hat_sfmmu.c
@@ -1940,7 +1940,7 @@ hat_free_end(struct hat *sfmmup)
ASSERT(sfmmup->sfmmu_ttecnt[TTE256M] == 0);
if (sfmmup->sfmmu_rmstat) {
- hat_freestat(sfmmup->sfmmu_as, NULL);
+ hat_freestat(sfmmup->sfmmu_as, 0);
}
while (sfmmup->sfmmu_tsb != NULL) {
@@ -10085,7 +10085,7 @@ sfmmu_check_page_sizes(sfmmu_t *sfmmup, int growing)
* Kernel threads, processes with small address spaces not using
* large pages, and dummy ISM HATs need not apply.
*/
- if (sfmmup == ksfmmup || sfmmup->sfmmu_ismhat != NULL)
+ if (sfmmup == ksfmmup || sfmmup->sfmmu_ismhat != 0)
return;
if (!SFMMU_LGPGS_INUSE(sfmmup) &&
@@ -12077,7 +12077,7 @@ sfmmu_ismtlbcache_demap(caddr_t addr, sfmmu_t *ism_sfmmup,
*/
ASSERT(ism_sfmmup->sfmmu_ismhat);
ASSERT(MUTEX_HELD(&ism_mlist_lock));
- addr = addr - ISMID_STARTADDR;
+ addr = (caddr_t)((uintptr_t)addr - (uintptr_t)ISMID_STARTADDR);
for (ment = ism_sfmmup->sfmmu_iment; ment; ment = ment->iment_next) {
diff --git a/usr/src/uts/sparc/fs/proc/prmachdep.c b/usr/src/uts/sparc/fs/proc/prmachdep.c
index 734f36610f..dc2119f7ba 100644
--- a/usr/src/uts/sparc/fs/proc/prmachdep.c
+++ b/usr/src/uts/sparc/fs/proc/prmachdep.c
@@ -25,7 +25,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
#include <sys/types.h>
#include <sys/t_lock.h>
@@ -422,7 +422,7 @@ prgetprfpregs(klwp_t *lwp, prfpregset_t *pfp)
* This is supposed to be a pointer to the floating point queue.
* We can't provide such a thing through the /proc interface.
*/
- pfp->pr_filler = NULL;
+ pfp->pr_filler = 0;
/*
* XXX: to be done: fetch the FP queue if it is non-empty.
*/
@@ -443,7 +443,7 @@ prgetprfpregs32(klwp_t *lwp, prfpregset32_t *pfp)
* This is supposed to be a pointer to the floating point queue.
* We can't provide such a thing through the /proc interface.
*/
- pfp->pr_filler = NULL;
+ pfp->pr_filler = 0;
/*
* XXX: to be done: fetch the FP queue if it is non-empty.
*/
diff --git a/usr/src/uts/sparc/syscall/getcontext.c b/usr/src/uts/sparc/syscall/getcontext.c
index c9adb54b86..aa933e5d23 100644
--- a/usr/src/uts/sparc/syscall/getcontext.c
+++ b/usr/src/uts/sparc/syscall/getcontext.c
@@ -25,7 +25,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
#include <sys/param.h>
#include <sys/types.h>
@@ -87,7 +87,7 @@ savecontext(ucontext_t *ucp, const k_sigset_t *mask)
* been disabled for this LWP. If stack bounds checking is disabled
* or the copyin() fails, we fall back to the legacy behavior.
*/
- if (lwp->lwp_ustack == NULL ||
+ if (lwp->lwp_ustack == (uintptr_t)NULL ||
copyin((void *)lwp->lwp_ustack, &ucp->uc_stack,
sizeof (ucp->uc_stack)) != 0 ||
ucp->uc_stack.ss_size == 0) {
@@ -384,7 +384,7 @@ savecontext32(ucontext32_t *ucp, const k_sigset_t *mask, struct fq32 *dfq)
* been disabled for this LWP. If stack bounds checking is disabled
* or the copyin() fails, we fall back to the legacy behavior.
*/
- if (lwp->lwp_ustack == NULL ||
+ if (lwp->lwp_ustack == (uintptr_t)NULL ||
copyin((void *)lwp->lwp_ustack, &ucp->uc_stack,
sizeof (ucp->uc_stack)) != 0 ||
ucp->uc_stack.ss_size == 0) {
@@ -410,7 +410,7 @@ savecontext32(ucontext32_t *ucp, const k_sigset_t *mask, struct fq32 *dfq)
if (ucp->uc_mcontext.fpregs.fpu_en == 0)
ucp->uc_flags &= ~UC_FPU;
- ucp->uc_mcontext.gwins = (caddr32_t)NULL;
+ ucp->uc_mcontext.gwins = (caddr32_t)(uintptr_t)NULL;
/*
* Save signal mask (the 32- and 64-bit sigset_t structures are
@@ -464,7 +464,7 @@ getsetcontext32(int flag, void *arg)
* a later setcontext(2).
*/
uc.uc_mcontext.fpregs.fpu_qcnt = 0;
- uc.uc_mcontext.fpregs.fpu_q = (caddr32_t)NULL;
+ uc.uc_mcontext.fpregs.fpu_q = (caddr32_t)(uintptr_t)NULL;
if (copyout(&uc, arg, sizeof (ucontext32_t)))
return (set_errno(EFAULT));
diff --git a/usr/src/uts/sparc/v9/os/v9dep.c b/usr/src/uts/sparc/v9/os/v9dep.c
index 654aee9167..38a905995f 100644
--- a/usr/src/uts/sparc/v9/os/v9dep.c
+++ b/usr/src/uts/sparc/v9/os/v9dep.c
@@ -20,7 +20,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
@@ -121,7 +121,7 @@ setfpregs(klwp_t *lwp, fpregset_t *fp)
/*
* Load up a user's floating point context.
*/
- if (fp->fpu_qcnt > MAXFPQ) /* plug security holes */
+ if (fp->fpu_qcnt > MAXFPQ) /* plug security holes */
fp->fpu_qcnt = MAXFPQ;
fp->fpu_q_entrysize = sizeof (struct _fq);
@@ -819,7 +819,7 @@ setregs(uarg_t *args)
rp->r_y = 0;
curthread->t_post_sys = 1;
lwp->lwp_eosys = JUSTRETURN;
- lwp->lwp_pcb.pcb_trap0addr = NULL; /* no trap 0 handler */
+ lwp->lwp_pcb.pcb_trap0addr = 0; /* no trap 0 handler */
/*
* Clear the fixalignment flag
*/
@@ -1425,7 +1425,7 @@ sendsig32(int sig, k_siginfo_t *sip, void (*hdlr)())
gwp = NULL;
sp += gwin_size;
} else {
- suword32_noerr(&fp->uc.uc_mcontext.gwins, (uint32_t)NULL);
+ suword32_noerr(&fp->uc.uc_mcontext.gwins, 0);
}
if (fpq_size != 0) {
@@ -1455,8 +1455,7 @@ sendsig32(int sig, k_siginfo_t *sip, void (*hdlr)())
mpcb->mpcb_flags |= FP_TRAPPED;
} else {
- suword32_noerr(&fp->uc.uc_mcontext.fpregs.fpu_q,
- (uint32_t)NULL);
+ suword32_noerr(&fp->uc.uc_mcontext.fpregs.fpu_q, 0);
suword8_noerr(&fp->uc.uc_mcontext.fpregs.fpu_qcnt, 0);
}
@@ -1724,7 +1723,7 @@ fpuregset_nto32(const fpregset_t *src, fpregset32_t *dest, struct fq32 *dfq)
bzero(dest, sizeof (*dest));
for (i = 0; i < 32; i++)
dest->fpu_fr.fpu_regs[i] = src->fpu_fr.fpu_regs[i];
- dest->fpu_q = NULL;
+ dest->fpu_q = 0;
dest->fpu_fsr = (uint32_t)src->fpu_fsr;
dest->fpu_qcnt = src->fpu_qcnt;
dest->fpu_q_entrysize = sizeof (struct fpq32);
diff --git a/usr/src/uts/sun4/io/ivintr.c b/usr/src/uts/sun4/io/ivintr.c
index 1a6cd93eaf..0a80e9da55 100644
--- a/usr/src/uts/sun4/io/ivintr.c
+++ b/usr/src/uts/sun4/io/ivintr.c
@@ -268,7 +268,7 @@ add_softintr(uint_t pil, softintrfunc intr_handler, caddr_t intr_arg1,
intr_vec_t *iv_p;
if (pil > PIL_MAX)
- return (NULL);
+ return ((uint64_t)NULL);
iv_p = iv_alloc(type);
diff --git a/usr/src/uts/sun4/os/machdep.c b/usr/src/uts/sun4/os/machdep.c
index 556dbd71e1..ec92618c08 100644
--- a/usr/src/uts/sun4/os/machdep.c
+++ b/usr/src/uts/sun4/os/machdep.c
@@ -452,7 +452,7 @@ cpu_create_intrstat(cpu_t *cp)
zoneid = ALL_ZONES;
intr_ksp = kstat_create_zone("cpu", cp->cpu_id, "intrstat", "misc",
- KSTAT_TYPE_NAMED, PIL_MAX * 2, NULL, zoneid);
+ KSTAT_TYPE_NAMED, PIL_MAX * 2, 0, zoneid);
/*
* Initialize each PIL's named kstat
diff --git a/usr/src/uts/sun4/os/mlsetup.c b/usr/src/uts/sun4/os/mlsetup.c
index b9ade98a26..a4c4d4059a 100644
--- a/usr/src/uts/sun4/os/mlsetup.c
+++ b/usr/src/uts/sun4/os/mlsetup.c
@@ -408,7 +408,7 @@ kobj_start(void *cif)
prom_panic("no ELF image");
ehdr = (Ehdr *)(uintptr_t)eadr;
for (i = 0; i < BA_NUM; i++)
- bootaux[i].ba_val = NULL;
+ bootaux[i].ba_val = 0;
bootaux[BA_PHNUM].ba_val = ehdr->e_phnum;
bootaux[BA_PHENT].ba_val = ehdr->e_phentsize;
bootaux[BA_LDNAME].ba_ptr = NULL;
diff --git a/usr/src/uts/sun4/os/mp_states.c b/usr/src/uts/sun4/os/mp_states.c
index d5f55006b4..d615011f9a 100644
--- a/usr/src/uts/sun4/os/mp_states.c
+++ b/usr/src/uts/sun4/os/mp_states.c
@@ -102,7 +102,7 @@ idle_other_cpus(void)
return;
xt_some(cpu_idle_set, (xcfunc_t *)idle_stop_xcall,
- (uint64_t)cpu_idle_self, NULL);
+ (uint64_t)cpu_idle_self, 0);
for (i = 0; i < NCPU; i++) {
if (!CPU_IN_SET(cpu_idle_set, i))
@@ -215,7 +215,7 @@ mp_cpu_quiesce(cpu_t *cp0)
volatile cpu_t *cp = (volatile cpu_t *) cp0;
int i, sanity_limit = cpu_quiesce_microsecond_sanity_limit;
int cpuid = cp->cpu_id;
- int found_intr = 1;
+ int found_intr = 1;
static fn_t f = "mp_cpu_quiesce";
ASSERT(CPU->cpu_id != cpuid);
diff --git a/usr/src/uts/sun4/os/x_call.c b/usr/src/uts/sun4/os/x_call.c
index 521f740c82..4583ca32cb 100644
--- a/usr/src/uts/sun4/os/x_call.c
+++ b/usr/src/uts/sun4/os/x_call.c
@@ -90,7 +90,8 @@ void send_mondo_set(cpuset_t set);
* values.
*/
static int
-xc_func_timeout_adj(cpu_setup_t what, int cpuid) {
+xc_func_timeout_adj(cpu_setup_t what, int cpuid)
+{
uint64_t freq = cpunodes[cpuid].clock_freq;
switch (what) {
@@ -756,7 +757,7 @@ xc_attention(cpuset_t cpuset)
CPUSET_DEL(xc_cpuset, lcx);
XC_STAT_INC(x_dstat[lcx][XC_ATTENTION]);
- XC_TRACE(XC_ATTENTION, &xc_cpuset, NULL, NULL, NULL);
+ XC_TRACE(XC_ATTENTION, &xc_cpuset, NULL, 0, 0);
if (CPUSET_ISNULL(xc_cpuset))
return;
@@ -843,7 +844,7 @@ xc_dismissed(cpuset_t cpuset)
* exclude itself
*/
CPUSET_DEL(xc_cpuset, lcx);
- XC_TRACE(XC_DISMISSED, &xc_cpuset, NULL, NULL, NULL);
+ XC_TRACE(XC_DISMISSED, &xc_cpuset, NULL, 0, 0);
if (CPUSET_ISNULL(xc_cpuset)) {
xc_holder = -1;
mutex_exit(&xc_sys_mutex);
@@ -963,9 +964,9 @@ xc_loop(void)
*
* The owner of xc_sys_mutex (or xc_holder) can expect
* its xc/xt requests are handled as follows:
- * xc requests use xc_mbox's handshaking for their services
- * xt requests at TL>0 will be handled immediately
- * xt requests at TL=0:
+ * xc requests use xc_mbox's handshaking for their services
+ * xt requests at TL>0 will be handled immediately
+ * xt requests at TL=0:
* if their handlers'pils are <= XCALL_PIL, then
* they will be handled after xc_loop exits
* (so, they probably should not be used)
@@ -976,7 +977,7 @@ xc_loop(void)
* the requests will be handled as follows:
* xc requests will be handled after they grab xc_sys_mutex
* xt requests at TL>0 will be handled immediately
- * xt requests at TL=0:
+ * xt requests at TL=0:
* if their handlers'pils are <= XCALL_PIL, then
* they will be handled after xc_loop exits
* else they will be handled immediately
@@ -988,7 +989,7 @@ xc_loop(void)
CPUSET_ADD(tset, lcx);
membar_stld();
XC_STAT_INC(x_rstat[lcx][XC_LOOP]);
- XC_TRACE(XC_LOOP_ENTER, &tset, NULL, NULL, NULL);
+ XC_TRACE(XC_LOOP_ENTER, &tset, NULL, 0, 0);
while (xmp->xc_state != XC_EXIT) {
if (xmp->xc_state == XC_DOIT) {
func = xmp->xc_func;
@@ -1026,7 +1027,7 @@ xc_loop(void)
}
ASSERT(xmp->xc_state == XC_EXIT);
ASSERT(xc_holder != -1);
- XC_TRACE(XC_LOOP_EXIT, &tset, NULL, NULL, NULL);
+ XC_TRACE(XC_LOOP_EXIT, &tset, NULL, 0, 0);
xmp->xc_state = XC_IDLE;
membar_stld();
return (1);
diff --git a/usr/src/uts/sun4u/os/fillsysinfo.c b/usr/src/uts/sun4u/os/fillsysinfo.c
index f90a3a2c72..62bac4dd53 100644
--- a/usr/src/uts/sun4u/os/fillsysinfo.c
+++ b/usr/src/uts/sun4u/os/fillsysinfo.c
@@ -1153,7 +1153,7 @@ have_eeprom(pnode_t node)
/*
* If we have a chosen eeprom and it is not this node, keep looking.
*/
- if (chosen_eeprom != NULL && chosen_eeprom != node) {
+ if (chosen_eeprom != 0 && chosen_eeprom != node) {
v_timecheck_addr = (caddr_t)(uintptr_t)eaddr;
return;
}
diff --git a/usr/src/uts/sun4u/os/mach_cpu_states.c b/usr/src/uts/sun4u/os/mach_cpu_states.c
index 4481efa2fe..bb18efa79d 100644
--- a/usr/src/uts/sun4u/os/mach_cpu_states.c
+++ b/usr/src/uts/sun4u/os/mach_cpu_states.c
@@ -100,7 +100,7 @@ mdboot(int cmd, int fcn, char *bootstr, boolean_t invoke_cb)
devtree_freeze();
if (invoke_cb)
- (void) callb_execute_class(CB_CL_MDBOOT, NULL);
+ (void) callb_execute_class(CB_CL_MDBOOT, 0);
/*
* Clear any unresolved UEs from memory.
@@ -252,7 +252,7 @@ panic_stopcpus(cpu_t *cp, kthread_t *t, int spl)
(void) splzs();
CPUSET_ALL_BUT(cps, cp->cpu_id);
- xt_some(cps, (xcfunc_t *)idle_stop_xcall, (uint64_t)&panic_idle, NULL);
+ xt_some(cps, (xcfunc_t *)idle_stop_xcall, (uint64_t)&panic_idle, 0);
for (i = 0; i < NCPU; i++) {
if (i != cp->cpu_id && CPU_XCALL_READY(i)) {
diff --git a/usr/src/uts/sun4v/os/intrq.c b/usr/src/uts/sun4v/os/intrq.c
index 329956b7dc..f104643e9c 100644
--- a/usr/src/uts/sun4v/os/intrq.c
+++ b/usr/src/uts/sun4v/os/intrq.c
@@ -195,7 +195,7 @@ cpu_intrq_cleanup(struct cpu *cpu)
if (mcpup->mondo_data) {
contig_mem_free(mcpup->mondo_data, INTR_REPORT_SIZE);
mcpup->mondo_data = NULL;
- mcpup->mondo_data_ra = NULL;
+ mcpup->mondo_data_ra = 0;
}
/*
@@ -216,7 +216,7 @@ cpu_intrq_cleanup(struct cpu *cpu)
if (mcpup->cpu_list) {
contig_mem_free(mcpup->cpu_list, cpu_list_size);
mcpup->cpu_list = NULL;
- mcpup->cpu_list_ra = NULL;
+ mcpup->cpu_list_ra = 0;
}
/*
@@ -226,7 +226,7 @@ cpu_intrq_cleanup(struct cpu *cpu)
cpu_q_size = cpu_q_entries * INTR_REPORT_SIZE;
contig_mem_free(mcpup->cpu_q_va, cpu_q_size);
mcpup->cpu_q_va = NULL;
- mcpup->cpu_q_base_pa = NULL;
+ mcpup->cpu_q_base_pa = 0;
mcpup->cpu_q_size = 0;
}
@@ -234,7 +234,7 @@ cpu_intrq_cleanup(struct cpu *cpu)
dev_q_size = dev_q_entries * INTR_REPORT_SIZE;
contig_mem_free(mcpup->dev_q_va, dev_q_size);
mcpup->dev_q_va = NULL;
- mcpup->dev_q_base_pa = NULL;
+ mcpup->dev_q_base_pa = 0;
mcpup->dev_q_size = 0;
}
@@ -242,7 +242,7 @@ cpu_intrq_cleanup(struct cpu *cpu)
cpu_rq_size = cpu_rq_entries * Q_ENTRY_SIZE;
contig_mem_free(mcpup->cpu_rq_va, 2 * cpu_rq_size);
mcpup->cpu_rq_va = NULL;
- mcpup->cpu_rq_base_pa = NULL;
+ mcpup->cpu_rq_base_pa = 0;
mcpup->cpu_rq_size = 0;
}
@@ -250,7 +250,7 @@ cpu_intrq_cleanup(struct cpu *cpu)
cpu_nrq_size = cpu_nrq_entries * Q_ENTRY_SIZE;
contig_mem_free(mcpup->cpu_nrq_va, 2 * cpu_nrq_size);
mcpup->cpu_nrq_va = NULL;
- mcpup->cpu_nrq_base_pa = NULL;
+ mcpup->cpu_nrq_base_pa = 0;
mcpup->cpu_nrq_size = 0;
}
}
diff --git a/usr/src/uts/sun4v/os/mach_cpu_states.c b/usr/src/uts/sun4v/os/mach_cpu_states.c
index f26f840967..9b72de9330 100644
--- a/usr/src/uts/sun4v/os/mach_cpu_states.c
+++ b/usr/src/uts/sun4v/os/mach_cpu_states.c
@@ -279,7 +279,7 @@ mdboot(int cmd, int fcn, char *bootstr, boolean_t invoke_cb)
devtree_freeze();
if (invoke_cb)
- (void) callb_execute_class(CB_CL_MDBOOT, NULL);
+ (void) callb_execute_class(CB_CL_MDBOOT, 0);
/*
* Clear any unresolved UEs from memory.
@@ -380,7 +380,7 @@ panic_stopcpus(cpu_t *cp, kthread_t *t, int spl)
(void) splzs();
CPUSET_ALL_BUT(cps, cp->cpu_id);
- xt_some(cps, (xcfunc_t *)idle_stop_xcall, (uint64_t)&panic_idle, NULL);
+ xt_some(cps, (xcfunc_t *)idle_stop_xcall, (uint64_t)&panic_idle, 0);
for (i = 0; i < NCPU; i++) {
if (i != cp->cpu_id && CPU_XCALL_READY(i)) {
@@ -589,8 +589,8 @@ ptl1_panic_handler(ptl1_state_t *pstate)
"CPU ECC error loop", /* PTL1_BAD_ECC */
"unexpected error from hypervisor call", /* PTL1_BAD_HCALL */
"unexpected global level(%gl)", /* PTL1_BAD_GL */
- "Watchdog Reset", /* PTL1_BAD_WATCHDOG */
- "unexpected RED mode trap", /* PTL1_BAD_RED */
+ "Watchdog Reset", /* PTL1_BAD_WATCHDOG */
+ "unexpected RED mode trap", /* PTL1_BAD_RED */
"return value EINVAL from hcall: "\
"UNMAP_PERM_ADDR", /* PTL1_BAD_HCALL_UNMAP_PERM_EINVAL */
"return value ENOMAP from hcall: "\
diff --git a/usr/src/uts/sun4v/os/mach_startup.c b/usr/src/uts/sun4v/os/mach_startup.c
index 5962239aef..983cdfbd5d 100644
--- a/usr/src/uts/sun4v/os/mach_startup.c
+++ b/usr/src/uts/sun4v/os/mach_startup.c
@@ -362,7 +362,7 @@ mach_htraptrace_setup(int cpuid)
contig_mem_alloc_align(HTRAP_TSIZE, HTRAP_TSIZE);
if (ctlp->d.hvaddr_base == NULL) {
ctlp->d.hlimit = 0;
- ctlp->d.hpaddr_base = NULL;
+ ctlp->d.hpaddr_base = 0;
cmn_err(CE_WARN, "!cpu%d: failed to allocate HV "
"traptrace buffer", cpuid);
} else {
@@ -425,7 +425,7 @@ mach_htraptrace_configure(int cpuid)
if (ret != H_EOK) {
ctlp->d.hvaddr_base = NULL;
ctlp->d.hlimit = 0;
- ctlp->d.hpaddr_base = NULL;
+ ctlp->d.hpaddr_base = 0;
}
}
} else {
@@ -438,7 +438,7 @@ mach_htraptrace_configure(int cpuid)
htrap_tr0_inuse = 0;
ctlp->d.hvaddr_base = NULL;
ctlp->d.hlimit = 0;
- ctlp->d.hpaddr_base = NULL;
+ ctlp->d.hpaddr_base = 0;
} else
cmn_err(CE_WARN,
"!cpu%d: HV traptracing is not disabled, "
@@ -468,7 +468,7 @@ mach_htraptrace_cleanup(int cpuid)
}
ctlp->d.hvaddr_base = NULL;
ctlp->d.hlimit = 0;
- ctlp->d.hpaddr_base = NULL;
+ ctlp->d.hpaddr_base = 0;
}
}
diff --git a/usr/src/uts/sun4v/os/mpo.c b/usr/src/uts/sun4v/os/mpo.c
index ad0cf0e78a..12b572db72 100644
--- a/usr/src/uts/sun4v/os/mpo.c
+++ b/usr/src/uts/sun4v/os/mpo.c
@@ -148,8 +148,8 @@ static int szc_mask0 = 0;
/* Save mblocks from the MD */
#define SMALL_MBLOCKS_COUNT 8
-static struct mblock_md *mpo_mblock;
-static struct mblock_md small_mpo_mblocks[SMALL_MBLOCKS_COUNT];
+static struct mblock_md *mpo_mblock;
+static struct mblock_md small_mpo_mblocks[SMALL_MBLOCKS_COUNT];
static int n_mblocks = 0;
/* Save mem_node stripes calculate from mblocks and lgroups. */
@@ -191,7 +191,7 @@ static void mnode_update(mpo_config_t *, pfn_t, pfn_t, update_t);
/* Debug support */
#if defined(DEBUG) && !defined(lint)
-#define VALIDATE_SLICE(base, end) { \
+#define VALIDATE_SLICE(base, end) { \
ASSERT(IS_P2ALIGNED(ptob(base), TTEBYTES(TTE256M))); \
ASSERT(IS_P2ALIGNED(ptob(end - base + 1), TTEBYTES(TTE256M))); \
}
@@ -307,7 +307,7 @@ cpuid_to_cpunode(md_t *md, int cpuid)
{
mde_cookie_t rootnode, foundnode, *cpunodes;
uint64_t cpuid_prop;
- int n_cpunodes, i;
+ int n_cpunodes, i;
if (md == NULL)
return (MDE_INVAL_ELEM_COOKIE);
@@ -1333,7 +1333,7 @@ valid_pages(md_t *md, mde_cookie_t cpu0)
* to get a sane mask.
*/
- if (cpu0 == NULL)
+ if (cpu0 == 0)
szc_mask = szc_mask0;
else {
if (md_get_prop_val(md, cpu0, "mmu-page-size-list", &szc_mask))
diff --git a/usr/src/uts/sun4v/os/suspend.c b/usr/src/uts/sun4v/os/suspend.c
index e81eb001a9..2d91c6da49 100644
--- a/usr/src/uts/sun4v/os/suspend.c
+++ b/usr/src/uts/sun4v/os/suspend.c
@@ -669,7 +669,7 @@ suspend_start(char *error_reason, size_t max_reason_len)
/* Set the {%tick,%stick}.NPT bits on all CPUs */
if (enable_user_tick_stick_emulation) {
- xc_all((xcfunc_t *)enable_tick_stick_npt, NULL, NULL);
+ xc_all((xcfunc_t *)enable_tick_stick_npt, 0, 0);
xt_sync(cpu_ready_set);
ASSERT(gettick_npt() != 0);
ASSERT(getstick_npt() != 0);
diff --git a/usr/src/uts/sun4v/vm/mach_sfmmu.c b/usr/src/uts/sun4v/vm/mach_sfmmu.c
index 398d0a069b..fcef120c0b 100644
--- a/usr/src/uts/sun4v/vm/mach_sfmmu.c
+++ b/usr/src/uts/sun4v/vm/mach_sfmmu.c
@@ -316,7 +316,7 @@ kdi_tlb_page_unlock(caddr_t va, int do_dtlb)
void
sfmmu_clear_utsbinfo()
{
- (void) hv_set_ctxnon0(0, NULL);
+ (void) hv_set_ctxnon0(0, 0);
}
/*