summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoreivind <eivind@FreeBSD.org>1999-12-21 11:14:12 +0000
committereivind <eivind@FreeBSD.org>1999-12-21 11:14:12 +0000
commit8befc1a2b84269c73c5f4bb55d5961c9c1e64866 (patch)
treeaa42526cc605d366c46f08ae42d166e1905b2fe7 /sys
parentd6a0d6a22e9b0ac0457c1471bc84b9240b8b5242 (diff)
downloadFreeBSD-src-8befc1a2b84269c73c5f4bb55d5961c9c1e64866.zip
FreeBSD-src-8befc1a2b84269c73c5f4bb55d5961c9c1e64866.tar.gz
Change incorrect NULLs to 0s
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/elf_machdep.c6
-rw-r--r--sys/dev/tx/if_tx.c2
-rw-r--r--sys/i386/i386/elf_machdep.c6
-rw-r--r--sys/kern/link_aout.c2
-rw-r--r--sys/netinet/in_pcb.c10
-rw-r--r--sys/netinet/udp_usrreq.c2
-rw-r--r--sys/netinet6/icmp6.c2
-rw-r--r--sys/netinet6/in6_pcb.c14
-rw-r--r--sys/netinet6/ip6_output.c6
-rw-r--r--sys/netinet6/udp6_usrreq.c9
-rw-r--r--sys/pci/if_tx.c2
-rw-r--r--sys/ufs/ffs/ffs_alloc.c2
12 files changed, 32 insertions, 31 deletions
diff --git a/sys/amd64/amd64/elf_machdep.c b/sys/amd64/amd64/elf_machdep.c
index 4369925..577aeac 100644
--- a/sys/amd64/amd64/elf_machdep.c
+++ b/sys/amd64/amd64/elf_machdep.c
@@ -68,7 +68,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
if (sym == NULL)
return -1;
addr = (Elf_Addr)linker_file_lookup_symbol(lf, sym, 1);
- if (addr == NULL)
+ if (addr == 0)
return -1;
addr += addend;
if (*where != addr)
@@ -79,7 +79,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
if (sym == NULL)
return -1;
addr = (Elf_Addr)linker_file_lookup_symbol(lf, sym, 1);
- if (addr == NULL)
+ if (addr == 0)
return -1;
addr += addend - (Elf_Addr)where;
if (*where != addr)
@@ -99,7 +99,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
if (sym == NULL)
return -1;
addr = (Elf_Addr)linker_file_lookup_symbol(lf, sym, 1);
- if (addr == NULL)
+ if (addr == 0)
return -1;
if (*where != addr)
*where = addr;
diff --git a/sys/dev/tx/if_tx.c b/sys/dev/tx/if_tx.c
index 9b797d4..288edbd 100644
--- a/sys/dev/tx/if_tx.c
+++ b/sys/dev/tx/if_tx.c
@@ -58,7 +58,7 @@
{ MGETHDR((m),M_DONTWAIT,MT_DATA); \
if (m) { \
MCLGET((m),M_DONTWAIT); \
- if( NULL == ((m)->m_flags & M_EXT) ){ \
+ if( 0 == ((m)->m_flags & M_EXT) ){ \
m_freem(m); \
(m) = NULL; \
} \
diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c
index 4369925..577aeac 100644
--- a/sys/i386/i386/elf_machdep.c
+++ b/sys/i386/i386/elf_machdep.c
@@ -68,7 +68,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
if (sym == NULL)
return -1;
addr = (Elf_Addr)linker_file_lookup_symbol(lf, sym, 1);
- if (addr == NULL)
+ if (addr == 0)
return -1;
addr += addend;
if (*where != addr)
@@ -79,7 +79,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
if (sym == NULL)
return -1;
addr = (Elf_Addr)linker_file_lookup_symbol(lf, sym, 1);
- if (addr == NULL)
+ if (addr == 0)
return -1;
addr += addend - (Elf_Addr)where;
if (*where != addr)
@@ -99,7 +99,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
if (sym == NULL)
return -1;
addr = (Elf_Addr)linker_file_lookup_symbol(lf, sym, 1);
- if (addr == NULL)
+ if (addr == 0)
return -1;
if (*where != addr)
*where = addr;
diff --git a/sys/kern/link_aout.c b/sys/kern/link_aout.c
index 605a812..6081a9c 100644
--- a/sys/kern/link_aout.c
+++ b/sys/kern/link_aout.c
@@ -467,7 +467,7 @@ link_aout_lookup_symbol(linker_file_t file, const char* name,
char* cp;
if (LD_BUCKETS(af->dynamic) == 0)
- return NULL;
+ return 0;
hashbase = AOUT_RELOC(af, struct rrs_hash, LD_HASH(af->dynamic));
symbolbase = AOUT_RELOC(af, struct nzlist, LD_SYMBOL(af->dynamic));
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 71d091b..b3f6d61 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -662,7 +662,7 @@ in_pcbnotify(head, dst, fport_arg, laddr, lport_arg, cmd, notify)
s = splnet();
for (inp = head->lh_first; inp != NULL;) {
#ifdef INET6
- if ((inp->inp_vflag & INP_IPV4) == NULL) {
+ if ((inp->inp_vflag & INP_IPV4) == 0) {
inp = LIST_NEXT(inp, inp_list);
continue;
}
@@ -759,7 +759,7 @@ in_pcblookup_local(pcbinfo, laddr, lport_arg, wild_okay)
head = &pcbinfo->hashbase[INP_PCBHASH(INADDR_ANY, lport, 0, pcbinfo->hashmask)];
for (inp = head->lh_first; inp != NULL; inp = inp->inp_hash.le_next) {
#ifdef INET6
- if ((inp->inp_vflag & INP_IPV4) == NULL)
+ if ((inp->inp_vflag & INP_IPV4) == 0)
continue;
#endif
if (inp->inp_faddr.s_addr == INADDR_ANY &&
@@ -800,7 +800,7 @@ in_pcblookup_local(pcbinfo, laddr, lport_arg, wild_okay)
inp = inp->inp_portlist.le_next) {
wildcard = 0;
#ifdef INET6
- if ((inp->inp_vflag & INP_IPV4) == NULL)
+ if ((inp->inp_vflag & INP_IPV4) == 0)
continue;
#endif
if (inp->inp_faddr.s_addr != INADDR_ANY)
@@ -849,7 +849,7 @@ in_pcblookup_hash(pcbinfo, faddr, fport_arg, laddr, lport_arg, wildcard,
head = &pcbinfo->hashbase[INP_PCBHASH(faddr.s_addr, lport, fport, pcbinfo->hashmask)];
for (inp = head->lh_first; inp != NULL; inp = inp->inp_hash.le_next) {
#ifdef INET6
- if ((inp->inp_vflag & INP_IPV4) == NULL)
+ if ((inp->inp_vflag & INP_IPV4) == 0)
continue;
#endif
if (inp->inp_faddr.s_addr == faddr.s_addr &&
@@ -871,7 +871,7 @@ in_pcblookup_hash(pcbinfo, faddr, fport_arg, laddr, lport_arg, wildcard,
head = &pcbinfo->hashbase[INP_PCBHASH(INADDR_ANY, lport, 0, pcbinfo->hashmask)];
for (inp = head->lh_first; inp != NULL; inp = inp->inp_hash.le_next) {
#ifdef INET6
- if ((inp->inp_vflag & INP_IPV4) == NULL)
+ if ((inp->inp_vflag & INP_IPV4) == 0)
continue;
#endif
if (inp->inp_faddr.s_addr == INADDR_ANY &&
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 03e0ab7..bc854de 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -251,7 +251,7 @@ udp_input(m, off, proto)
#endif
LIST_FOREACH(inp, &udb, inp_list) {
#ifdef INET6
- if ((inp->inp_vflag & INP_IPV4) == NULL)
+ if ((inp->inp_vflag & INP_IPV4) == 0)
continue;
#endif
if (inp->inp_lport != uh->uh_dport)
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 943ddf7..f7d03cd 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1070,7 +1070,7 @@ icmp6_rip6_input(mp, off)
LIST_FOREACH(in6p, &ripcb, inp_list)
{
- if ((in6p->inp_vflag & INP_IPV6) == NULL)
+ if ((in6p->inp_vflag & INP_IPV6) == 0)
continue;
if (in6p->in6p_ip6_nxt != IPPROTO_ICMPV6)
continue;
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
index 8d65ade..89db824 100644
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -801,7 +801,7 @@ in6_mapped_sockaddr(struct socket *so, struct sockaddr **nam)
return EINVAL;
if (inp->inp_vflag & INP_IPV4) {
error = in_setsockaddr(so, nam);
- if (error == NULL)
+ if (error == 0)
in6_sin_2_v4mapsin6_in_sock(nam);
} else
error = in6_setsockaddr(so, nam);
@@ -819,7 +819,7 @@ in6_mapped_peeraddr(struct socket *so, struct sockaddr **nam)
return EINVAL;
if (inp->inp_vflag & INP_IPV4) {
error = in_setpeeraddr(so, nam);
- if (error == NULL)
+ if (error == 0)
in6_sin_2_v4mapsin6_in_sock(nam);
} else
error = in6_setpeeraddr(so, nam);
@@ -875,7 +875,7 @@ in6_pcbnotify(head, dst, fport_arg, laddr6, lport_arg, cmd, notify)
errno = inet6ctlerrmap[cmd];
s = splnet();
for (inp = LIST_FIRST(head); inp != NULL;) {
- if ((inp->inp_vflag & INP_IPV6) == NULL) {
+ if ((inp->inp_vflag & INP_IPV6) == 0) {
inp = LIST_NEXT(inp, inp_list);
continue;
}
@@ -919,7 +919,7 @@ in6_pcblookup_local(pcbinfo, laddr, lport_arg, wild_okay)
head = &pcbinfo->hashbase[INP_PCBHASH(INADDR_ANY, lport, 0,
pcbinfo->hashmask)];
LIST_FOREACH(inp, head, inp_hash) {
- if ((inp->inp_vflag & INP_IPV6) == NULL)
+ if ((inp->inp_vflag & INP_IPV6) == 0)
continue;
if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr) &&
IN6_ARE_ADDR_EQUAL(&inp->in6p_laddr, laddr) &&
@@ -957,7 +957,7 @@ in6_pcblookup_local(pcbinfo, laddr, lport_arg, wild_okay)
*/
LIST_FOREACH(inp, &phd->phd_pcblist, inp_portlist) {
wildcard = 0;
- if ((inp->inp_vflag & INP_IPV6) == NULL)
+ if ((inp->inp_vflag & INP_IPV6) == 0)
continue;
if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr))
wildcard++;
@@ -1060,7 +1060,7 @@ in6_pcblookup_hash(pcbinfo, faddr, fport_arg, laddr, lport_arg, wildcard, ifp)
lport, fport,
pcbinfo->hashmask)];
LIST_FOREACH(inp, head, inp_hash) {
- if ((inp->inp_vflag & INP_IPV6) == NULL)
+ if ((inp->inp_vflag & INP_IPV6) == 0)
continue;
if (IN6_ARE_ADDR_EQUAL(&inp->in6p_faddr, faddr) &&
IN6_ARE_ADDR_EQUAL(&inp->in6p_laddr, laddr) &&
@@ -1078,7 +1078,7 @@ in6_pcblookup_hash(pcbinfo, faddr, fport_arg, laddr, lport_arg, wildcard, ifp)
head = &pcbinfo->hashbase[INP_PCBHASH(INADDR_ANY, lport, 0,
pcbinfo->hashmask)];
LIST_FOREACH(inp, head, inp_hash) {
- if ((inp->inp_vflag & INP_IPV6) == NULL)
+ if ((inp->inp_vflag & INP_IPV6) == 0)
continue;
if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr) &&
inp->inp_lport == lport) {
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index b86f0fe..c5876f9 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1161,10 +1161,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;
return (ip6_pcbopts(&in6p->in6p_outputopts,
m, so, sopt));
@@ -2100,7 +2100,7 @@ ip6_mloopback(ifp, m, dst)
copym = m_copy(m, 0, M_COPYALL);
if (copym != NULL) {
- (void)if_simloop(ifp, copym, (struct sockaddr *)dst, NULL);
+ (void)if_simloop(ifp, copym, (struct sockaddr *)dst, 0);
}
}
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
index 30d8a73..137c3ee 100644
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -226,7 +226,7 @@ udp6_input(mp, offp, proto)
*/
last = NULL;
LIST_FOREACH(in6p, &udb, inp_list) {
- if ((in6p->inp_vflag & INP_IPV6) == NULL)
+ if ((in6p->inp_vflag & INP_IPV6) == 0)
continue;
if (in6p->in6p_lport != uh->uh_dport)
continue;
@@ -407,6 +407,7 @@ udp6_ctlinput(cmd, sa, d)
sa->sa_len != sizeof(struct sockaddr_in6))
return;
+ off = 0;
if (!PRC_IS_REDIRECT(cmd) &&
((unsigned)cmd >= PRC_NCMDS || inet6ctlerrmap[cmd] == 0))
return;
@@ -665,7 +666,7 @@ udp6_bind(struct socket *so, struct sockaddr *nam, struct proc *p)
inp->inp_vflag &= ~INP_IPV4;
inp->inp_vflag |= INP_IPV6;
- if (ip6_mapped_addr_on && (inp->inp_flags & IN6P_BINDV6ONLY) == NULL) {
+ if (ip6_mapped_addr_on && (inp->inp_flags & IN6P_BINDV6ONLY) == 0) {
struct sockaddr_in6 *sin6_p;
sin6_p = (struct sockaddr_in6 *)nam;
@@ -714,7 +715,7 @@ udp6_connect(struct socket *so, struct sockaddr *nam, struct proc *p)
s = splnet();
error = in_pcbconnect(inp, (struct sockaddr *)&sin, p);
splx(s);
- if (error == NULL) {
+ if (error == 0) {
inp->inp_vflag |= INP_IPV4;
inp->inp_vflag &= ~INP_IPV6;
soisconnected(so);
@@ -733,7 +734,7 @@ udp6_connect(struct socket *so, struct sockaddr *nam, struct proc *p)
(htonl(ip6_flow_seq++) & IPV6_FLOWLABEL_MASK);
}
splx(s);
- if (error == NULL) {
+ if (error == 0) {
if (ip6_mapped_addr_on) { /* should be non mapped addr */
inp->inp_vflag &= ~INP_IPV4;
inp->inp_vflag |= INP_IPV6;
diff --git a/sys/pci/if_tx.c b/sys/pci/if_tx.c
index 9b797d4..288edbd 100644
--- a/sys/pci/if_tx.c
+++ b/sys/pci/if_tx.c
@@ -58,7 +58,7 @@
{ MGETHDR((m),M_DONTWAIT,MT_DATA); \
if (m) { \
MCLGET((m),M_DONTWAIT); \
- if( NULL == ((m)->m_flags & M_EXT) ){ \
+ if( 0 == ((m)->m_flags & M_EXT) ){ \
m_freem(m); \
(m) = NULL; \
} \
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index f676937..c3e1c31 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -1106,7 +1106,7 @@ ffs_clusteralloc(ip, cg, bpref, len)
fs = ip->i_fs;
if (fs->fs_maxcluster[cg] < len)
- return (NULL);
+ return (0);
if (bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize,
NOCRED, &bp))
goto fail;
OpenPOWER on IntegriCloud