kern: for pointers replace 0 with NULL.
These are mostly cosmetical, no functional change. Found with devel/coccinelle.
This commit is contained in:
parent
59c3cb81c1
commit
b85f65af68
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298069
@ -174,7 +174,7 @@ dumpsys_cb_dumpdata(struct dump_pa *mdp, int seqnr, void *arg)
|
|||||||
|
|
||||||
error = 0; /* catch case in which chunk size is 0 */
|
error = 0; /* catch case in which chunk size is 0 */
|
||||||
counter = 0; /* Update twiddle every 16MB */
|
counter = 0; /* Update twiddle every 16MB */
|
||||||
va = 0;
|
va = NULL;
|
||||||
pgs = mdp->pa_size / PAGE_SIZE;
|
pgs = mdp->pa_size / PAGE_SIZE;
|
||||||
pa = mdp->pa_start;
|
pa = mdp->pa_start;
|
||||||
maxdumppgs = min(di->maxiosize / PAGE_SIZE, MAXDUMPPGS);
|
maxdumppgs = min(di->maxiosize / PAGE_SIZE, MAXDUMPPGS);
|
||||||
|
@ -445,7 +445,7 @@ kproc_kthread_add(void (*func)(void *), void *arg,
|
|||||||
char buf[100];
|
char buf[100];
|
||||||
struct thread *td;
|
struct thread *td;
|
||||||
|
|
||||||
if (*procptr == 0) {
|
if (*procptr == NULL) {
|
||||||
error = kproc_create(func, arg,
|
error = kproc_create(func, arg,
|
||||||
procptr, flags, pages, "%s", procname);
|
procptr, flags, pages, "%s", procname);
|
||||||
if (error)
|
if (error)
|
||||||
|
@ -1444,7 +1444,7 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS)
|
|||||||
p = LIST_FIRST(&allproc);
|
p = LIST_FIRST(&allproc);
|
||||||
else
|
else
|
||||||
p = LIST_FIRST(&zombproc);
|
p = LIST_FIRST(&zombproc);
|
||||||
for (; p != 0; p = LIST_NEXT(p, p_list)) {
|
for (; p != NULL; p = LIST_NEXT(p, p_list)) {
|
||||||
/*
|
/*
|
||||||
* Skip embryonic processes.
|
* Skip embryonic processes.
|
||||||
*/
|
*/
|
||||||
|
@ -912,7 +912,7 @@ sysctl_sysctl_name(SYSCTL_HANDLER_ARGS)
|
|||||||
name++;
|
name++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
lsp2 = 0;
|
lsp2 = NULL;
|
||||||
SLIST_FOREACH(oid, lsp, oid_link) {
|
SLIST_FOREACH(oid, lsp, oid_link) {
|
||||||
if (oid->oid_number != *name)
|
if (oid->oid_number != *name)
|
||||||
continue;
|
continue;
|
||||||
@ -1083,7 +1083,7 @@ sysctl_sysctl_name2oid(SYSCTL_HANDLER_ARGS)
|
|||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
int error, oid[CTL_MAXNAME], len = 0;
|
int error, oid[CTL_MAXNAME], len = 0;
|
||||||
struct sysctl_oid *op = 0;
|
struct sysctl_oid *op = NULL;
|
||||||
struct rm_priotracker tracker;
|
struct rm_priotracker tracker;
|
||||||
|
|
||||||
if (!req->newlen)
|
if (!req->newlen)
|
||||||
|
@ -1382,7 +1382,7 @@ link_elf_search_symbol(linker_file_t lf, caddr_t value,
|
|||||||
u_long diff = off;
|
u_long diff = off;
|
||||||
u_long st_value;
|
u_long st_value;
|
||||||
const Elf_Sym* es;
|
const Elf_Sym* es;
|
||||||
const Elf_Sym* best = 0;
|
const Elf_Sym* best = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) {
|
for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) {
|
||||||
@ -1400,7 +1400,7 @@ link_elf_search_symbol(linker_file_t lf, caddr_t value,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (best == 0)
|
if (best == NULL)
|
||||||
*diffp = off;
|
*diffp = off;
|
||||||
else
|
else
|
||||||
*diffp = diff;
|
*diffp = diff;
|
||||||
|
@ -1180,7 +1180,7 @@ link_elf_search_symbol(linker_file_t lf, caddr_t value,
|
|||||||
u_long diff = off;
|
u_long diff = off;
|
||||||
u_long st_value;
|
u_long st_value;
|
||||||
const Elf_Sym *es;
|
const Elf_Sym *es;
|
||||||
const Elf_Sym *best = 0;
|
const Elf_Sym *best = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) {
|
for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) {
|
||||||
@ -1198,7 +1198,7 @@ link_elf_search_symbol(linker_file_t lf, caddr_t value,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (best == 0)
|
if (best == NULL)
|
||||||
*diffp = off;
|
*diffp = off;
|
||||||
else
|
else
|
||||||
*diffp = diff;
|
*diffp = diff;
|
||||||
|
@ -980,8 +980,8 @@ sys_semop(struct thread *td, struct semop_args *uap)
|
|||||||
size_t nsops = uap->nsops;
|
size_t nsops = uap->nsops;
|
||||||
struct sembuf *sops;
|
struct sembuf *sops;
|
||||||
struct semid_kernel *semakptr;
|
struct semid_kernel *semakptr;
|
||||||
struct sembuf *sopptr = 0;
|
struct sembuf *sopptr = NULL;
|
||||||
struct sem *semptr = 0;
|
struct sem *semptr = NULL;
|
||||||
struct sem_undo *suptr;
|
struct sem_undo *suptr;
|
||||||
struct mtx *sema_mtxp;
|
struct mtx *sema_mtxp;
|
||||||
size_t i, j, k;
|
size_t i, j, k;
|
||||||
|
@ -459,7 +459,7 @@ m_copym(struct mbuf *m, int off0, int len, int wait)
|
|||||||
m = m->m_next;
|
m = m->m_next;
|
||||||
}
|
}
|
||||||
np = ⊤
|
np = ⊤
|
||||||
top = 0;
|
top = NULL;
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
if (m == NULL) {
|
if (m == NULL) {
|
||||||
KASSERT(len == M_COPYALL,
|
KASSERT(len == M_COPYALL,
|
||||||
|
@ -593,7 +593,7 @@ sbappend_locked(struct sockbuf *sb, struct mbuf *m, int flags)
|
|||||||
|
|
||||||
SOCKBUF_LOCK_ASSERT(sb);
|
SOCKBUF_LOCK_ASSERT(sb);
|
||||||
|
|
||||||
if (m == 0)
|
if (m == NULL)
|
||||||
return;
|
return;
|
||||||
sbm_clrprotoflags(m, flags);
|
sbm_clrprotoflags(m, flags);
|
||||||
SBLASTRECORDCHK(sb);
|
SBLASTRECORDCHK(sb);
|
||||||
@ -746,7 +746,7 @@ sbappendrecord_locked(struct sockbuf *sb, struct mbuf *m0)
|
|||||||
|
|
||||||
SOCKBUF_LOCK_ASSERT(sb);
|
SOCKBUF_LOCK_ASSERT(sb);
|
||||||
|
|
||||||
if (m0 == 0)
|
if (m0 == NULL)
|
||||||
return;
|
return;
|
||||||
m_clrprotoflags(m0);
|
m_clrprotoflags(m0);
|
||||||
/*
|
/*
|
||||||
@ -885,7 +885,7 @@ sbappendcontrol_locked(struct sockbuf *sb, struct mbuf *m0,
|
|||||||
|
|
||||||
SOCKBUF_LOCK_ASSERT(sb);
|
SOCKBUF_LOCK_ASSERT(sb);
|
||||||
|
|
||||||
if (control == 0)
|
if (control == NULL)
|
||||||
panic("sbappendcontrol_locked");
|
panic("sbappendcontrol_locked");
|
||||||
space = m_length(control, &n) + m_length(m0, NULL);
|
space = m_length(control, &n) + m_length(m0, NULL);
|
||||||
|
|
||||||
|
@ -430,7 +430,7 @@ kern_accept4(struct thread *td, int s, struct sockaddr **name,
|
|||||||
(void) fo_ioctl(nfp, FIONBIO, &tmp, td->td_ucred, td);
|
(void) fo_ioctl(nfp, FIONBIO, &tmp, td->td_ucred, td);
|
||||||
tmp = fflag & FASYNC;
|
tmp = fflag & FASYNC;
|
||||||
(void) fo_ioctl(nfp, FIOASYNC, &tmp, td->td_ucred, td);
|
(void) fo_ioctl(nfp, FIOASYNC, &tmp, td->td_ucred, td);
|
||||||
sa = 0;
|
sa = NULL;
|
||||||
error = soaccept(so, &sa);
|
error = soaccept(so, &sa);
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
goto noconnection;
|
goto noconnection;
|
||||||
|
@ -368,7 +368,7 @@ cluster_rbuild(struct vnode *vp, u_quad_t filesize, daddr_t lbn,
|
|||||||
return tbp;
|
return tbp;
|
||||||
|
|
||||||
bp = trypbuf(&cluster_pbuf_freecnt);
|
bp = trypbuf(&cluster_pbuf_freecnt);
|
||||||
if (bp == 0)
|
if (bp == NULL)
|
||||||
return tbp;
|
return tbp;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -102,7 +102,7 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *nep,
|
|||||||
register struct radix_node_head *rnh;
|
register struct radix_node_head *rnh;
|
||||||
register int i;
|
register int i;
|
||||||
struct radix_node *rn;
|
struct radix_node *rn;
|
||||||
struct sockaddr *saddr, *smask = 0;
|
struct sockaddr *saddr, *smask = NULL;
|
||||||
#if defined(INET6) || defined(INET)
|
#if defined(INET6) || defined(INET)
|
||||||
int off;
|
int off;
|
||||||
#endif
|
#endif
|
||||||
|
@ -486,7 +486,7 @@ int
|
|||||||
lookup(struct nameidata *ndp)
|
lookup(struct nameidata *ndp)
|
||||||
{
|
{
|
||||||
char *cp; /* pointer into pathname argument */
|
char *cp; /* pointer into pathname argument */
|
||||||
struct vnode *dp = 0; /* the directory we are searching */
|
struct vnode *dp = NULL; /* the directory we are searching */
|
||||||
struct vnode *tdp; /* saved dp */
|
struct vnode *tdp; /* saved dp */
|
||||||
struct mount *mp; /* mount table entry */
|
struct mount *mp; /* mount table entry */
|
||||||
struct prison *pr;
|
struct prison *pr;
|
||||||
@ -949,7 +949,7 @@ lookup(struct nameidata *ndp)
|
|||||||
int
|
int
|
||||||
relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
|
relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
|
||||||
{
|
{
|
||||||
struct vnode *dp = 0; /* the directory we are searching */
|
struct vnode *dp = NULL; /* the directory we are searching */
|
||||||
int wantparent; /* 1 => wantparent or lockparent flag */
|
int wantparent; /* 1 => wantparent or lockparent flag */
|
||||||
int rdonly; /* lookup read-only flag bit */
|
int rdonly; /* lookup read-only flag bit */
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
@ -123,7 +123,7 @@ strtol(nptr, endptr, base)
|
|||||||
acc = neg ? LONG_MIN : LONG_MAX;
|
acc = neg ? LONG_MIN : LONG_MAX;
|
||||||
} else if (neg)
|
} else if (neg)
|
||||||
acc = -acc;
|
acc = -acc;
|
||||||
if (endptr != 0)
|
if (endptr != NULL)
|
||||||
*endptr = __DECONST(char *, any ? s - 1 : nptr);
|
*endptr = __DECONST(char *, any ? s - 1 : nptr);
|
||||||
return (acc);
|
return (acc);
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ strtoq(const char *nptr, char **endptr, int base)
|
|||||||
acc = neg ? QUAD_MIN : QUAD_MAX;
|
acc = neg ? QUAD_MIN : QUAD_MAX;
|
||||||
} else if (neg)
|
} else if (neg)
|
||||||
acc = -acc;
|
acc = -acc;
|
||||||
if (endptr != 0)
|
if (endptr != NULL)
|
||||||
*endptr = __DECONST(char *, any ? s - 1 : nptr);
|
*endptr = __DECONST(char *, any ? s - 1 : nptr);
|
||||||
return (acc);
|
return (acc);
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ strtoul(nptr, endptr, base)
|
|||||||
acc = ULONG_MAX;
|
acc = ULONG_MAX;
|
||||||
} else if (neg)
|
} else if (neg)
|
||||||
acc = -acc;
|
acc = -acc;
|
||||||
if (endptr != 0)
|
if (endptr != NULL)
|
||||||
*endptr = __DECONST(char *, any ? s - 1 : nptr);
|
*endptr = __DECONST(char *, any ? s - 1 : nptr);
|
||||||
return (acc);
|
return (acc);
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ strtouq(const char *nptr, char **endptr, int base)
|
|||||||
acc = UQUAD_MAX;
|
acc = UQUAD_MAX;
|
||||||
} else if (neg)
|
} else if (neg)
|
||||||
acc = -acc;
|
acc = -acc;
|
||||||
if (endptr != 0)
|
if (endptr != NULL)
|
||||||
*endptr = __DECONST(char *, any ? s - 1 : nptr);
|
*endptr = __DECONST(char *, any ? s - 1 : nptr);
|
||||||
return (acc);
|
return (acc);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user