summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-12-23 02:36:43 +0000
committerpeter <peter@FreeBSD.org>2003-12-23 02:36:43 +0000
commit7cc77e03ae647ad532a0a4b708811e38ed15c9e4 (patch)
treed22ef24bdd562f18d9dfc77f257b3dd71335c80f /sys
parent409dd19ac040f6465a4e73882c919f0dc679c18e (diff)
downloadFreeBSD-src-7cc77e03ae647ad532a0a4b708811e38ed15c9e4.zip
FreeBSD-src-7cc77e03ae647ad532a0a4b708811e38ed15c9e4.tar.gz
Catch a few places where NULL (pointer) was used where 0 (integer) was
expected.
Diffstat (limited to 'sys')
-rw-r--r--sys/alpha/alpha/db_trace.c6
-rw-r--r--sys/alpha/alpha/dump_machdep.c8
-rw-r--r--sys/alpha/pci/apecs.c2
-rw-r--r--sys/dev/firewire/fwohci.c8
-rw-r--r--sys/dev/gfb/gfb_pci.c4
-rw-r--r--sys/dev/mpt/mpt_pci.c2
-rw-r--r--sys/kern/kern_clock.c2
-rw-r--r--sys/kern/uipc_mbuf.c2
-rw-r--r--sys/netinet/ip_fastfwd.c9
-rw-r--r--sys/netinet6/in6_src.c2
-rw-r--r--sys/netinet6/ip6_mroute.c2
-rw-r--r--sys/netinet6/ip6_output.c6
-rw-r--r--sys/pci/if_rl.c2
-rw-r--r--sys/sys/umtx.h2
14 files changed, 28 insertions, 29 deletions
diff --git a/sys/alpha/alpha/db_trace.c b/sys/alpha/alpha/db_trace.c
index c203168..b269dc0 100644
--- a/sys/alpha/alpha/db_trace.c
+++ b/sys/alpha/alpha/db_trace.c
@@ -99,7 +99,7 @@ static struct special_symbol {
{ (uintptr_t)&XentSys, "syscall" },
{ (uintptr_t)&XentUna, "unaligned access fault" },
{ (uintptr_t)&XentRestart, "console restart" },
- { NULL }
+ { 0, NULL }
};
@@ -180,7 +180,7 @@ sym_is_trapsymbol(uintptr_t v)
{
int i;
- for (i = 0; special_symbols[i].ss_val != NULL; ++i)
+ for (i = 0; special_symbols[i].ss_val != 0; ++i)
if (v == special_symbols[i].ss_val)
return 1;
return 0;
@@ -339,7 +339,7 @@ db_stack_trace_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, char *m
if (sym_is_trapsymbol(symval)) {
tf = (struct trapframe *)frame;
- for (i = 0; special_symbols[i].ss_val != NULL; ++i)
+ for (i = 0; special_symbols[i].ss_val != 0; ++i)
if (symval == special_symbols[i].ss_val)
db_printf("--- %s",
special_symbols[i].ss_note);
diff --git a/sys/alpha/alpha/dump_machdep.c b/sys/alpha/alpha/dump_machdep.c
index 0b5a883..42523d7 100644
--- a/sys/alpha/alpha/dump_machdep.c
+++ b/sys/alpha/alpha/dump_machdep.c
@@ -88,7 +88,7 @@ dumpsys(struct dumperinfo *di)
dumplo = di->mediaoffset + di->mediasize - Maxmem * (off_t)PAGE_SIZE;
dumplo -= sizeof kdh * 2;
- i = di->dumper(di->priv, &kdh, NULL, dumplo, sizeof kdh);
+ i = di->dumper(di->priv, &kdh, 0, dumplo, sizeof kdh);
if (i)
printf("\nDump failed writing header (%d)\n", i);
dumplo += sizeof kdh;
@@ -111,7 +111,7 @@ dumpsys(struct dumperinfo *di)
printf(" %d", count / (1024 * 1024 / PAGE_SIZE));
mb = i;
}
- i = di->dumper(di->priv, va, NULL, dumplo, left * PAGE_SIZE);
+ i = di->dumper(di->priv, va, 0, dumplo, left * PAGE_SIZE);
if (i)
break;
count += left;
@@ -120,10 +120,10 @@ dumpsys(struct dumperinfo *di)
}
if (i)
printf("\nDump failed writing data (%d)\n", i);
- i = di->dumper(di->priv, &kdh, NULL, dumplo, sizeof kdh);
+ i = di->dumper(di->priv, &kdh, 0, dumplo, sizeof kdh);
if (i)
printf("\nDump failed writing trailer (%d)\n", i);
- di->dumper(di->priv, NULL, NULL, 0, 0); /* tell them we are done */
+ di->dumper(di->priv, NULL, 0, 0, 0); /* tell them we are done */
printf("\nDump complete\n");
return;
}
diff --git a/sys/alpha/pci/apecs.c b/sys/alpha/pci/apecs.c
index cd9da04..a7cce49 100644
--- a/sys/alpha/pci/apecs.c
+++ b/sys/alpha/pci/apecs.c
@@ -292,7 +292,7 @@ apecs_attach(device_t dev)
sc->smem_base = APECS_PCI_SPARSE;
sc->io_base = APECS_PCI_SIO;
sc->cfg0_base = KV(APECS_PCI_CONF);
- sc->cfg1_base = NULL;
+ sc->cfg1_base = 0;
set_iointr(alpha_dispatch_intr);
diff --git a/sys/dev/firewire/fwohci.c b/sys/dev/firewire/fwohci.c
index 63cbbec..ba54a7c 100644
--- a/sys/dev/firewire/fwohci.c
+++ b/sys/dev/firewire/fwohci.c
@@ -1314,7 +1314,7 @@ fwohci_tx_enable(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
{
int err = 0;
int idb, z, i, dmach = 0, ldesc;
- u_int32_t off = NULL;
+ u_int32_t off = 0;
struct fwohcidb_tr *db_tr;
struct fwohcidb *db;
@@ -1329,7 +1329,7 @@ fwohci_tx_enable(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
break;
}
}
- if(off == NULL){
+ if(off == 0){
err = EINVAL;
return err;
}
@@ -1373,7 +1373,7 @@ fwohci_rx_enable(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
{
int err = 0;
int idb, z, i, dmach = 0, ldesc;
- u_int32_t off = NULL;
+ u_int32_t off = 0;
struct fwohcidb_tr *db_tr;
struct fwohcidb *db;
@@ -1390,7 +1390,7 @@ fwohci_rx_enable(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
}
}
}
- if(off == NULL){
+ if(off == 0){
err = EINVAL;
return err;
}
diff --git a/sys/dev/gfb/gfb_pci.c b/sys/dev/gfb/gfb_pci.c
index 4527f0b..d36e2d8 100644
--- a/sys/dev/gfb/gfb_pci.c
+++ b/sys/dev/gfb/gfb_pci.c
@@ -136,9 +136,9 @@ pcigfb_attach(device_t dev)
adp->va_mem_base = (vm_offset_t)rman_get_virtual(sc->res);
adp->va_mem_size = rman_get_end(sc->res) -
rman_get_start(sc->res);
- adp->va_io_base = NULL;
+ adp->va_io_base = 0;
adp->va_io_size = 0;
- adp->va_crtc_addr = NULL;
+ adp->va_crtc_addr = 0;
gfb_device_softcs[sc->model][unit] = sc;
sc->gfbc = (struct gfb_conf *)malloc(sizeof(struct gfb_conf),
M_DEVBUF, M_NOWAIT);
diff --git a/sys/dev/mpt/mpt_pci.c b/sys/dev/mpt/mpt_pci.c
index afc0684..f0b8003 100644
--- a/sys/dev/mpt/mpt_pci.c
+++ b/sys/dev/mpt/mpt_pci.c
@@ -474,7 +474,7 @@ mpt_dma_mem_alloc(mpt_softc_t *mpt)
device_t dev = mpt->dev;
/* Check if we alreay have allocated the reply memory */
- if (mpt->reply_phys != NULL) {
+ if (mpt->reply_phys != 0) {
return 0;
}
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index c09e9d6..63e3fcf 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -359,7 +359,7 @@ stopprofclock(p)
p->p_flag |= P_STOPPROF;
while (p->p_profthreads != 0)
msleep(&p->p_profthreads, &p->p_mtx, PPAUSE,
- "stopprof", NULL);
+ "stopprof", 0);
p->p_flag &= ~P_STOPPROF;
}
mtx_lock_spin(&sched_lock);
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index aa6e532..574b336 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -897,7 +897,7 @@ m_defrag(struct mbuf *m0, int how)
if (m_final == NULL)
goto nospace;
- if (m_dup_pkthdr(m_final, m0, how) == NULL)
+ if (m_dup_pkthdr(m_final, m0, how) == 0)
goto nospace;
m_new = m_final;
diff --git a/sys/netinet/ip_fastfwd.c b/sys/netinet/ip_fastfwd.c
index 667a04c..4041712 100644
--- a/sys/netinet/ip_fastfwd.c
+++ b/sys/netinet/ip_fastfwd.c
@@ -463,7 +463,7 @@ passin:
if (!ipstealth) {
#endif
if (ip->ip_ttl <= IPTTLDEC) {
- icmp_error(m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS, NULL, NULL);
+ icmp_error(m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS, 0, NULL);
return 1;
}
@@ -503,7 +503,7 @@ passin:
} else {
ipstat.ips_noroute++;
ipstat.ips_cantforward++;
- icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, NULL, NULL);
+ icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, NULL);
if (ro.ro_rt)
RTFREE(ro.ro_rt);
return 1;
@@ -707,8 +707,7 @@ droptoours: /* Used for DIVERT */
} else {
ipstat.ips_noroute++;
ipstat.ips_cantforward++;
- icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST,
- NULL, NULL);
+ icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, NULL);
if (ro.ro_rt)
RTFREE(ro.ro_rt);
return 1;
@@ -750,7 +749,7 @@ droptoours: /* Used for DIVERT */
*/
if (ip->ip_off & IP_DF) {
icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG,
- NULL, ifp);
+ 0, ifp);
ipstat.ips_cantfrag++;
RTFREE(ro.ro_rt);
return 1;
diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c
index 88ace1c..ab513a8 100644
--- a/sys/netinet6/in6_src.c
+++ b/sys/netinet6/in6_src.c
@@ -640,7 +640,7 @@ in6_selectroute(dstsock, opts, mopts, ro, retifp, retrt, clone)
rtalloc((struct route *)ro);
} else {
ro->ro_rt = rtalloc1(&((struct route *)ro)
- ->ro_dst, NULL, 0UL);
+ ->ro_dst, 0, 0UL);
if (ro->ro_rt)
RT_UNLOCK(ro->ro_rt);
}
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
index a68237e..95872b8 100644
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -1857,7 +1857,7 @@ pim6_input(mp, offp, proto)
#endif
rc = if_simloop(mif6table[reg_mif_num].m6_ifp, m,
- dst.sin6_family, NULL);
+ dst.sin6_family, 0);
/* prepare the register head to send to the mrouting daemon */
m = mcp;
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index 99addae..55dbd03 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1481,10 +1481,10 @@ ip6_ctloutput(so, sopt)
struct mbuf *m;
error = soopt_getm(sopt, &m); /* XXX */
- if (error != NULL)
+ if (error != 0)
break;
error = soopt_mcopyin(sopt, m); /* XXX */
- if (error != NULL)
+ if (error != 0)
break;
error = ip6_pcbopts(&in6p->in6p_outputopts,
m, so, sopt);
@@ -3405,7 +3405,7 @@ ip6_mloopback(ifp, m, dst)
in6_clearscope(&ip6->ip6_src);
in6_clearscope(&ip6->ip6_dst);
- (void)if_simloop(ifp, copym, dst->sin6_family, NULL);
+ (void)if_simloop(ifp, copym, dst->sin6_family, 0);
}
/*
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c
index 921d047..1e3863f 100644
--- a/sys/pci/if_rl.c
+++ b/sys/pci/if_rl.c
@@ -170,7 +170,7 @@ static struct rl_type rl_devs[] = {
"LevelOne FPC-0106TX" },
{ EDIMAX_VENDORID, EDIMAX_DEVICEID_EP4103DL, RL_8139,
"Edimax EP-4103DL CardBus" },
- { 0, 0, NULL }
+ { 0, 0, 0, NULL }
};
static int rl_probe (device_t);
diff --git a/sys/sys/umtx.h b/sys/sys/umtx.h
index 7b6b3f4..2098248 100644
--- a/sys/sys/umtx.h
+++ b/sys/sys/umtx.h
@@ -34,7 +34,7 @@
* See pthread_*
*/
-#define UMTX_UNOWNED NULL
+#define UMTX_UNOWNED 0x0
#define UMTX_CONTESTED 0x1
OpenPOWER on IntegriCloud