Date: Fri, 15 Apr 2016 16:10:11 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298069 - in head/sys: kern libkern Message-ID: <201604151610.u3FGABxn089826@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Fri Apr 15 16:10:11 2016 New Revision: 298069 URL: https://svnweb.freebsd.org/changeset/base/298069 Log: kern: for pointers replace 0 with NULL. These are mostly cosmetical, no functional change. Found with devel/coccinelle. Modified: head/sys/kern/kern_dump.c head/sys/kern/kern_kthread.c head/sys/kern/kern_proc.c head/sys/kern/kern_sysctl.c head/sys/kern/link_elf.c head/sys/kern/link_elf_obj.c head/sys/kern/sysv_sem.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_sockbuf.c head/sys/kern/uipc_syscalls.c head/sys/kern/vfs_cluster.c head/sys/kern/vfs_export.c head/sys/kern/vfs_lookup.c head/sys/libkern/strtol.c head/sys/libkern/strtoq.c head/sys/libkern/strtoul.c head/sys/libkern/strtouq.c Modified: head/sys/kern/kern_dump.c ============================================================================== --- head/sys/kern/kern_dump.c Fri Apr 15 16:05:41 2016 (r298068) +++ head/sys/kern/kern_dump.c Fri Apr 15 16:10:11 2016 (r298069) @@ -174,7 +174,7 @@ dumpsys_cb_dumpdata(struct dump_pa *mdp, error = 0; /* catch case in which chunk size is 0 */ counter = 0; /* Update twiddle every 16MB */ - va = 0; + va = NULL; pgs = mdp->pa_size / PAGE_SIZE; pa = mdp->pa_start; maxdumppgs = min(di->maxiosize / PAGE_SIZE, MAXDUMPPGS); Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Fri Apr 15 16:05:41 2016 (r298068) +++ head/sys/kern/kern_kthread.c Fri Apr 15 16:10:11 2016 (r298069) @@ -445,7 +445,7 @@ kproc_kthread_add(void (*func)(void *), char buf[100]; struct thread *td; - if (*procptr == 0) { + if (*procptr == NULL) { error = kproc_create(func, arg, procptr, flags, pages, "%s", procname); if (error) Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Fri Apr 15 16:05:41 2016 (r298068) +++ head/sys/kern/kern_proc.c Fri Apr 15 16:10:11 2016 (r298069) @@ -1444,7 +1444,7 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) p = LIST_FIRST(&allproc); else 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. */ Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Fri Apr 15 16:05:41 2016 (r298068) +++ head/sys/kern/kern_sysctl.c Fri Apr 15 16:10:11 2016 (r298069) @@ -912,7 +912,7 @@ sysctl_sysctl_name(SYSCTL_HANDLER_ARGS) name++; continue; } - lsp2 = 0; + lsp2 = NULL; SLIST_FOREACH(oid, lsp, oid_link) { if (oid->oid_number != *name) continue; @@ -1083,7 +1083,7 @@ sysctl_sysctl_name2oid(SYSCTL_HANDLER_AR { char *p; int error, oid[CTL_MAXNAME], len = 0; - struct sysctl_oid *op = 0; + struct sysctl_oid *op = NULL; struct rm_priotracker tracker; if (!req->newlen) Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Fri Apr 15 16:05:41 2016 (r298068) +++ head/sys/kern/link_elf.c Fri Apr 15 16:10:11 2016 (r298069) @@ -1382,7 +1382,7 @@ link_elf_search_symbol(linker_file_t lf, u_long diff = off; u_long st_value; const Elf_Sym* es; - const Elf_Sym* best = 0; + const Elf_Sym* best = NULL; int i; for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) { @@ -1400,7 +1400,7 @@ link_elf_search_symbol(linker_file_t lf, } } } - if (best == 0) + if (best == NULL) *diffp = off; else *diffp = diff; Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Fri Apr 15 16:05:41 2016 (r298068) +++ head/sys/kern/link_elf_obj.c Fri Apr 15 16:10:11 2016 (r298069) @@ -1180,7 +1180,7 @@ link_elf_search_symbol(linker_file_t lf, u_long diff = off; u_long st_value; const Elf_Sym *es; - const Elf_Sym *best = 0; + const Elf_Sym *best = NULL; int i; for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) { @@ -1198,7 +1198,7 @@ link_elf_search_symbol(linker_file_t lf, } } } - if (best == 0) + if (best == NULL) *diffp = off; else *diffp = diff; Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Fri Apr 15 16:05:41 2016 (r298068) +++ head/sys/kern/sysv_sem.c Fri Apr 15 16:10:11 2016 (r298069) @@ -980,8 +980,8 @@ sys_semop(struct thread *td, struct semo size_t nsops = uap->nsops; struct sembuf *sops; struct semid_kernel *semakptr; - struct sembuf *sopptr = 0; - struct sem *semptr = 0; + struct sembuf *sopptr = NULL; + struct sem *semptr = NULL; struct sem_undo *suptr; struct mtx *sema_mtxp; size_t i, j, k; Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Fri Apr 15 16:05:41 2016 (r298068) +++ head/sys/kern/uipc_mbuf.c Fri Apr 15 16:10:11 2016 (r298069) @@ -459,7 +459,7 @@ m_copym(struct mbuf *m, int off0, int le m = m->m_next; } np = ⊤ - top = 0; + top = NULL; while (len > 0) { if (m == NULL) { KASSERT(len == M_COPYALL, Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Fri Apr 15 16:05:41 2016 (r298068) +++ head/sys/kern/uipc_sockbuf.c Fri Apr 15 16:10:11 2016 (r298069) @@ -593,7 +593,7 @@ sbappend_locked(struct sockbuf *sb, stru SOCKBUF_LOCK_ASSERT(sb); - if (m == 0) + if (m == NULL) return; sbm_clrprotoflags(m, flags); SBLASTRECORDCHK(sb); @@ -746,7 +746,7 @@ sbappendrecord_locked(struct sockbuf *sb SOCKBUF_LOCK_ASSERT(sb); - if (m0 == 0) + if (m0 == NULL) return; m_clrprotoflags(m0); /* @@ -885,7 +885,7 @@ sbappendcontrol_locked(struct sockbuf *s SOCKBUF_LOCK_ASSERT(sb); - if (control == 0) + if (control == NULL) panic("sbappendcontrol_locked"); space = m_length(control, &n) + m_length(m0, NULL); Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Fri Apr 15 16:05:41 2016 (r298068) +++ head/sys/kern/uipc_syscalls.c Fri Apr 15 16:10:11 2016 (r298069) @@ -430,7 +430,7 @@ kern_accept4(struct thread *td, int s, s (void) fo_ioctl(nfp, FIONBIO, &tmp, td->td_ucred, td); tmp = fflag & FASYNC; (void) fo_ioctl(nfp, FIOASYNC, &tmp, td->td_ucred, td); - sa = 0; + sa = NULL; error = soaccept(so, &sa); if (error != 0) goto noconnection; Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Fri Apr 15 16:05:41 2016 (r298068) +++ head/sys/kern/vfs_cluster.c Fri Apr 15 16:10:11 2016 (r298069) @@ -368,7 +368,7 @@ cluster_rbuild(struct vnode *vp, u_quad_ return tbp; bp = trypbuf(&cluster_pbuf_freecnt); - if (bp == 0) + if (bp == NULL) return tbp; /* Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Fri Apr 15 16:05:41 2016 (r298068) +++ head/sys/kern/vfs_export.c Fri Apr 15 16:10:11 2016 (r298069) @@ -102,7 +102,7 @@ vfs_hang_addrlist(struct mount *mp, stru register struct radix_node_head *rnh; register int i; struct radix_node *rn; - struct sockaddr *saddr, *smask = 0; + struct sockaddr *saddr, *smask = NULL; #if defined(INET6) || defined(INET) int off; #endif Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Fri Apr 15 16:05:41 2016 (r298068) +++ head/sys/kern/vfs_lookup.c Fri Apr 15 16:10:11 2016 (r298069) @@ -486,7 +486,7 @@ int lookup(struct nameidata *ndp) { 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 mount *mp; /* mount table entry */ struct prison *pr; @@ -949,7 +949,7 @@ bad: int 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 rdonly; /* lookup read-only flag bit */ int error = 0; Modified: head/sys/libkern/strtol.c ============================================================================== --- head/sys/libkern/strtol.c Fri Apr 15 16:05:41 2016 (r298068) +++ head/sys/libkern/strtol.c Fri Apr 15 16:10:11 2016 (r298069) @@ -123,7 +123,7 @@ strtol(nptr, endptr, base) acc = neg ? LONG_MIN : LONG_MAX; } else if (neg) acc = -acc; - if (endptr != 0) + if (endptr != NULL) *endptr = __DECONST(char *, any ? s - 1 : nptr); return (acc); } Modified: head/sys/libkern/strtoq.c ============================================================================== --- head/sys/libkern/strtoq.c Fri Apr 15 16:05:41 2016 (r298068) +++ head/sys/libkern/strtoq.c Fri Apr 15 16:10:11 2016 (r298069) @@ -124,7 +124,7 @@ strtoq(const char *nptr, char **endptr, acc = neg ? QUAD_MIN : QUAD_MAX; } else if (neg) acc = -acc; - if (endptr != 0) + if (endptr != NULL) *endptr = __DECONST(char *, any ? s - 1 : nptr); return (acc); } Modified: head/sys/libkern/strtoul.c ============================================================================== --- head/sys/libkern/strtoul.c Fri Apr 15 16:05:41 2016 (r298068) +++ head/sys/libkern/strtoul.c Fri Apr 15 16:10:11 2016 (r298069) @@ -102,7 +102,7 @@ strtoul(nptr, endptr, base) acc = ULONG_MAX; } else if (neg) acc = -acc; - if (endptr != 0) + if (endptr != NULL) *endptr = __DECONST(char *, any ? s - 1 : nptr); return (acc); } Modified: head/sys/libkern/strtouq.c ============================================================================== --- head/sys/libkern/strtouq.c Fri Apr 15 16:05:41 2016 (r298068) +++ head/sys/libkern/strtouq.c Fri Apr 15 16:10:11 2016 (r298069) @@ -101,7 +101,7 @@ strtouq(const char *nptr, char **endptr, acc = UQUAD_MAX; } else if (neg) acc = -acc; - if (endptr != 0) + if (endptr != NULL) *endptr = __DECONST(char *, any ? s - 1 : nptr); return (acc); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604151610.u3FGABxn089826>