Date: Tue, 3 Aug 2010 13:34:47 +0400 From: pluknet <pluknet@gmail.com> To: FreeBSD Current <freebsd-current@freebsd.org> Subject: [patch] big whitespace cleanup in sys/kern/* Message-ID: <AANLkTi=E%2Bzg5rNSv0Dg6uG%2Baxxvz=vrRVdug0JiNhbHG@mail.gmail.com>
index | next in thread | raw e-mail
[-- Attachment #1 --]
Hi.
I looked into sys/kern/* files to fix a bunch of common w/s style issues (221):
- leading space before label;
- leading space(s) before <tab>;
- space(s) instead of <tab>(s);
- space(s) in blank like.
I tried to be conservative and didn't touch semi-contrib files and
those with its own style.
Here is a diff I'd like someone look into and check in if there will
no objections.
--
wbr,
pluknet
[-- Attachment #2 --]
Index: kern_jail.c
===================================================================
--- kern_jail.c (revision 210768)
+++ kern_jail.c (working copy)
@@ -1043,7 +1043,7 @@
if (name[0] != '\0') {
namelen =
(ppr == &prison0) ? 0 : strlen(ppr->pr_name) + 1;
- name_again:
+name_again:
deadpr = NULL;
FOREACH_PRISON_CHILD(ppr, tpr) {
if (tpr != pr && tpr->pr_ref > 0 &&
@@ -1134,7 +1134,7 @@
if (jid == 0) {
/* Find the next free jid. */
jid = lastprid + 1;
- findnext:
+findnext:
if (jid == JAIL_MAX)
jid = 1;
TAILQ_FOREACH(tpr, &allprison, pr_list) {
@@ -1746,20 +1746,20 @@
td->td_retval[0] = pr->pr_id;
goto done_errmsg;
- done_deref_locked:
+done_deref_locked:
prison_deref(pr, created
? PD_LOCKED | PD_LIST_XLOCKED
: PD_DEREF | PD_LOCKED | PD_LIST_XLOCKED);
goto done_releroot;
- done_unlock_list:
+done_unlock_list:
sx_xunlock(&allprison_lock);
- done_releroot:
+done_releroot:
if (root != NULL) {
vfslocked = VFS_LOCK_GIANT(root->v_mount);
vrele(root);
VFS_UNLOCK_GIANT(vfslocked);
}
- done_errmsg:
+done_errmsg:
if (error) {
vfs_getopt(opts, "errmsg", (void **)&errmsg, &errmsg_len);
if (errmsg_len > 0) {
@@ -1776,7 +1776,7 @@
}
}
}
- done_free:
+done_free:
#ifdef INET
free(ip4, M_PRISON);
#endif
@@ -1906,7 +1906,7 @@
error = ENOENT;
goto done_unlock_list;
- found_prison:
+found_prison:
/* Get the parameters of the prison. */
pr->pr_ref++;
locked = PD_LOCKED;
@@ -2064,13 +2064,13 @@
}
goto done_errmsg;
- done_deref:
+done_deref:
prison_deref(pr, locked | PD_DEREF | PD_LIST_SLOCKED);
goto done_errmsg;
- done_unlock_list:
+done_unlock_list:
sx_sunlock(&allprison_lock);
- done_errmsg:
+done_errmsg:
if (error && errmsg_pos >= 0) {
vfs_getopt(opts, "errmsg", (void **)&errmsg, &errmsg_len);
errmsg_pos = 2 * errmsg_pos + 1;
@@ -2288,11 +2288,11 @@
crfree(oldcred);
prison_deref(ppr, PD_DEREF | PD_DEUREF);
return (0);
- e_unlock:
+e_unlock:
VOP_UNLOCK(pr->pr_root, 0);
- e_unlock_giant:
+e_unlock_giant:
VFS_UNLOCK_GIANT(vfslocked);
- e_revert_osd:
+e_revert_osd:
/* Tell modules this thread is still in its old jail after all. */
(void)osd_jail_call(ppr, PR_METHOD_ATTACH, td);
prison_deref(pr, PD_DEREF | PD_DEUREF);
@@ -2353,7 +2353,7 @@
sx_assert(&allprison_lock, SX_LOCKED);
mylen = (mypr == &prison0) ? 0 : strlen(mypr->pr_name) + 1;
- again:
+again:
deadpr = NULL;
FOREACH_PRISON_DESCENDANT(mypr, pr, descend) {
if (!strcmp(pr->pr_name + mylen, name)) {
@@ -3952,7 +3952,7 @@
sx_slock(&allprison_lock);
FOREACH_PRISON_DESCENDANT(pr, cpr, descend) {
#if defined(INET) || defined(INET6)
- again:
+again:
#endif
mtx_lock(&cpr->pr_mtx);
#ifdef INET
Index: kern_conf.c
===================================================================
--- kern_conf.c (revision 210768)
+++ kern_conf.c (working copy)
@@ -402,7 +402,7 @@
dev_relthread(dev);
return (retval);
}
-
+
static int
giant_read(struct cdev *dev, struct uio *uio, int ioflag)
{
Index: subr_eventhandler.c
===================================================================
--- subr_eventhandler.c (revision 210768)
+++ subr_eventhandler.c (working copy)
@@ -74,7 +74,7 @@
{
struct eventhandler_list *new_list;
struct eventhandler_entry *ep;
-
+
KASSERT(eventhandler_lists_initted, ("eventhandler registered too early"));
KASSERT(epn != NULL, ("%s: cannot register NULL event", __func__));
@@ -142,7 +142,7 @@
void *func, void *arg, int priority)
{
struct eventhandler_entry_generic *eg;
-
+
/* allocate an entry for this handler, populate it */
eg = malloc(sizeof(struct eventhandler_entry_generic), M_EVENTHANDLER,
M_WAITOK | M_ZERO);
@@ -166,7 +166,7 @@
void *func, void *arg, int priority, vimage_iterator_func_t iterfunc)
{
struct eventhandler_entry_generic_vimage *eg;
-
+
/* allocate an entry for this handler, populate it */
eg = malloc(sizeof(struct eventhandler_entry_generic_vimage),
M_EVENTHANDLER, M_WAITOK | M_ZERO);
@@ -246,14 +246,14 @@
if (!eventhandler_lists_initted)
return(NULL);
-
+
/* scan looking for the requested list */
mtx_lock(&eventhandler_mutex);
list = _eventhandler_find_list(name);
if (list != NULL)
EHL_LOCK(list);
mtx_unlock(&eventhandler_mutex);
-
+
return(list);
}
Index: sysv_msg.c
===================================================================
--- sysv_msg.c (revision 210768)
+++ sysv_msg.c (working copy)
@@ -222,7 +222,7 @@
i = 8;
while (i < 1024 && i != msginfo.msgssz)
i <<= 1;
- if (i != msginfo.msgssz) {
+ if (i != msginfo.msgssz) {
DPRINTF(("msginfo.msgssz=%d (0x%x)\n", msginfo.msgssz,
msginfo.msgssz));
panic("msginfo.msgssz not a small power of 2");
@@ -255,7 +255,7 @@
#ifdef MAC
mac_sysvmsg_init(&msghdrs[i]);
#endif
- }
+ }
free_msghdrs = &msghdrs[0];
if (msqids == NULL)
Index: kern_time.c
===================================================================
--- kern_time.c (revision 210768)
+++ kern_time.c (working copy)
@@ -1028,7 +1028,7 @@
it->it_sigev.sigev_signo = SIGALRM;
break;
case CLOCK_VIRTUAL:
- it->it_sigev.sigev_signo = SIGVTALRM;
+ it->it_sigev.sigev_signo = SIGVTALRM;
break;
case CLOCK_PROF:
it->it_sigev.sigev_signo = SIGPROF;
@@ -1394,7 +1394,7 @@
timespecsub(&ts, &cts);
TIMESPEC_TO_TIMEVAL(&tv, &ts);
callout_reset(&it->it_callout, tvtohz(&tv), realtimer_expire,
- it);
+ it);
}
}
Index: subr_kobj.c
===================================================================
--- subr_kobj.c (revision 210768)
+++ subr_kobj.c (working copy)
@@ -312,7 +312,7 @@
kobj_init(kobj_t obj, kobj_class_t cls)
{
KOBJ_ASSERT(MA_NOTOWNED);
- retry:
+retry:
KOBJ_LOCK();
/*
Index: uipc_mqueue.c
===================================================================
--- uipc_mqueue.c (revision 210768)
+++ uipc_mqueue.c (working copy)
@@ -1041,7 +1041,7 @@
int error;
if (ap->a_vp->v_type == VDIR)
- return (EPERM);
+ return (EPERM);
pn = VTON(ap->a_vp);
sx_xlock(&mqfs->mi_lock);
error = do_unlink(pn, ap->a_cnp->cn_cred);
@@ -1378,7 +1378,7 @@
tmp_ncookies = ap->a_ncookies;
*ap->a_ncookies = 0;
ap->a_ncookies = NULL;
- }
+ }
error = 0;
offset = 0;
@@ -1412,13 +1412,13 @@
pn->mn_type);
}
if (entry.d_reclen > uio->uio_resid)
- break;
+ break;
if (offset >= uio->uio_offset) {
error = vfs_read_dirent(ap, &entry, offset);
- if (error)
- break;
- }
- offset += entry.d_reclen;
+ if (error)
+ break;
+ }
+ offset += entry.d_reclen;
}
sx_xunlock(&mi->mi_lock);
@@ -1952,7 +1952,7 @@
}
error = copyinstr(upath, path, MQFS_NAMELEN + 1, NULL);
- if (error)
+ if (error)
return (error);
/*
@@ -2060,7 +2060,7 @@
int error, len;
error = copyinstr(uap->path, path, MQFS_NAMELEN + 1, NULL);
- if (error)
+ if (error)
return (error);
len = strlen(path);
@@ -2324,7 +2324,7 @@
{
struct filedesc *fdp;
struct mqueue *mq;
-
+
fdp = td->td_proc->p_fd;
FILEDESC_LOCK_ASSERT(fdp);
@@ -2412,7 +2412,7 @@
} else {
mq->mq_flags |= MQ_RSEL;
selrecord(td, &mq->mq_rsel);
- }
+ }
}
if (events & POLLOUT) {
if (mq->mq_curmsgs < mq->mq_maxmsg)
Index: vfs_vnops.c
===================================================================
--- vfs_vnops.c (revision 210768)
+++ vfs_vnops.c (working copy)
@@ -788,7 +788,7 @@
sb->st_ctim = vap->va_ctime;
sb->st_birthtim = vap->va_birthtime;
- /*
+ /*
* According to www.opengroup.org, the meaning of st_blksize is
* "a filesystem-specific preferred I/O block size for this
* object. In some filesystem types, this may vary from file
@@ -1028,7 +1028,7 @@
struct mount *mp;
int error;
- retry:
+retry:
if (vp != NULL) {
if ((error = VOP_GETWRITEMOUNT(vp, mpp)) != 0) {
*mpp = NULL;
Index: kern_thread.c
===================================================================
--- kern_thread.c (revision 210768)
+++ kern_thread.c (working copy)
@@ -852,7 +852,7 @@
PROC_SLOCK_ASSERT(p, MA_OWNED);
wakeup_swapper = 0;
if (!P_SHOULDSTOP(p)) {
- FOREACH_THREAD_IN_PROC(p, td) {
+ FOREACH_THREAD_IN_PROC(p, td) {
thread_lock(td);
if (TD_IS_SUSPENDED(td)) {
wakeup_swapper |= thread_unsuspend_one(td);
@@ -898,7 +898,7 @@
* to continue however as this is a bad place to stop.
*/
if ((p->p_numthreads != 1) && (!P_SHOULDSTOP(p))) {
- FOREACH_THREAD_IN_PROC(p, td) {
+ FOREACH_THREAD_IN_PROC(p, td) {
thread_lock(td);
if (TD_IS_SUSPENDED(td)) {
wakeup_swapper |= thread_unsuspend_one(td);
Index: subr_smp.c
===================================================================
--- subr_smp.c (revision 210768)
+++ subr_smp.c (working copy)
@@ -357,7 +357,7 @@
/* spin on entry rendezvous */
atomic_add_int(&smp_rv_waiters[1], 1);
while (smp_rv_waiters[1] < smp_rv_ncpus)
- cpu_spinwait();
+ cpu_spinwait();
}
/* action function */
@@ -367,7 +367,7 @@
/* spin on exit rendezvous */
atomic_add_int(&smp_rv_waiters[2], 1);
if (local_teardown_func == smp_no_rendevous_barrier)
- return;
+ return;
while (smp_rv_waiters[2] < smp_rv_ncpus)
cpu_spinwait();
Index: subr_kdb.c
===================================================================
--- subr_kdb.c (revision 210768)
+++ subr_kdb.c (working copy)
@@ -412,8 +412,8 @@
#if defined(SMP) && defined(KDB_STOPPEDPCB)
struct pcpu *pc;
#endif
-
- if (thr == curthread)
+
+ if (thr == curthread)
return (&kdb_pcb);
#if defined(SMP) && defined(KDB_STOPPEDPCB)
Index: sched_ule.c
===================================================================
--- sched_ule.c (revision 210768)
+++ sched_ule.c (working copy)
@@ -1682,7 +1682,7 @@
td->td_base_user_pri = prio;
if (td->td_flags & TDF_UBORROWING && td->td_user_pri <= prio)
- return;
+ return;
oldprio = td->td_user_pri;
td->td_user_pri = prio;
}
@@ -2089,7 +2089,7 @@
td->td_base_pri = td->td_user_pri;
tdq_setlowpri(TDQ_SELF(), td);
thread_unlock(td);
- }
+ }
}
/*
Index: kern_umtx.c
===================================================================
--- kern_umtx.c (revision 210768)
+++ kern_umtx.c (working copy)
@@ -1041,7 +1041,7 @@
umtxq_unlock(&uq->uq_key);
if (compat32 == 0)
tmp = fuword(addr);
- else
+ else
tmp = (unsigned int)fuword32(addr);
if (tmp != id) {
umtxq_lock(&uq->uq_key);
Index: link_elf_obj.c
===================================================================
--- link_elf_obj.c (revision 210768)
+++ link_elf_obj.c (working copy)
@@ -1376,15 +1376,15 @@
link_elf_symtab_get(linker_file_t lf, const Elf_Sym **symtab)
{
elf_file_t ef = (elf_file_t)lf;
-
+
*symtab = ef->ddbsymtab;
-
+
if (*symtab == NULL)
return (0);
return (ef->ddbsymcnt);
}
-
+
static long
link_elf_strtab_get(linker_file_t lf, caddr_t *strtab)
{
Index: uipc_syscalls.c
===================================================================
--- uipc_syscalls.c (revision 210768)
+++ uipc_syscalls.c (working copy)
@@ -2321,9 +2321,9 @@
* reference count. Otherwise, if the protocol calls sofree(),
* the socket will be released due to a zero refcount.
*/
- SOCK_LOCK(so);
- soref(so); /* file descriptor reference */
- SOCK_UNLOCK(so);
+ SOCK_LOCK(so);
+ soref(so); /* file descriptor reference */
+ SOCK_UNLOCK(so);
ACCEPT_LOCK();
@@ -2658,7 +2658,7 @@
}
auio.uio_iov = iov;
auio.uio_iovcnt = uap->iovlen;
- auio.uio_segflg = UIO_USERSPACE;
+ auio.uio_segflg = UIO_USERSPACE;
auio.uio_rw = UIO_READ;
auio.uio_td = td;
auio.uio_offset = 0; /* XXX */
Index: kern_switch.c
===================================================================
--- kern_switch.c (revision 210768)
+++ kern_switch.c (working copy)
@@ -115,16 +115,16 @@
{
struct sysctl_oid *p;
uintptr_t counter;
- int error;
+ int error;
int val;
int i;
- val = 0;
- error = sysctl_handle_int(oidp, &val, 0, req);
- if (error != 0 || req->newptr == NULL)
- return (error);
- if (val == 0)
- return (0);
+ val = 0;
+ error = sysctl_handle_int(oidp, &val, 0, req);
+ if (error != 0 || req->newptr == NULL)
+ return (error);
+ if (val == 0)
+ return (0);
/*
* Traverse the list of children of _kern_sched_stats and reset each
* to 0. Skip the reset entry.
Index: vfs_bio.c
===================================================================
--- vfs_bio.c (revision 210768)
+++ vfs_bio.c (working copy)
@@ -3179,9 +3179,9 @@
}
}
- /*
- * Call back function from struct bio back up to struct buf.
- */
+/*
+ * Call back function from struct bio back up to struct buf.
+ */
static void
bufdonebio(struct bio *bip)
{
Index: kern_sig.c
===================================================================
--- kern_sig.c (revision 210768)
+++ kern_sig.c (working copy)
@@ -2719,7 +2719,7 @@
PROC_SLOCK(p);
}
}
-
+
/*
* Take the action for the specified signal
* from the current set of pending signals.
@@ -2990,7 +2990,7 @@
#if defined(COMPRESS_USER_CORES)
int compress_user_cores = 1;
SYSCTL_INT(_kern, OID_AUTO, compress_user_cores, CTLFLAG_RW,
- &compress_user_cores, 0, "");
+ &compress_user_cores, 0, "");
int compress_user_cores_gzlevel = -1; /* default level */
SYSCTL_INT(_kern, OID_AUTO, compress_user_cores_gzlevel, CTLFLAG_RW,
@@ -3052,9 +3052,9 @@
"for corefile hostname\n",
(long)pid, name,
(u_long)uid);
- goto nomem;
- }
- }
+ goto nomem;
+ }
+ }
getcredhostname(td->td_ucred, hostname,
MAXHOSTNAMELEN);
sbuf_printf(&sb, "%s", hostname);
@@ -3123,7 +3123,7 @@
}
log(LOG_ERR,
"pid %d (%s), uid (%u): Path `%s' failed "
- "on initial open test, error = %d\n",
+ "on initial open test, error = %d\n",
pid, name, uid, temp, error);
free(temp, M_TEMP);
return (NULL);
@@ -3136,8 +3136,8 @@
if (error) {
log(LOG_ERR,
"pid %d (%s), uid (%u): Path `%s' failed "
- "on close after initial open test, "
- "error = %d\n",
+ "on close after initial open test, "
+ "error = %d\n",
pid, name, uid, temp, error);
free(temp, M_TEMP);
return (NULL);
Index: uipc_usrreq.c
===================================================================
--- uipc_usrreq.c (revision 210768)
+++ uipc_usrreq.c (working copy)
@@ -1935,9 +1935,9 @@
if (control != NULL)
for (n = control, n_prev = NULL; n != NULL;) {
cm = mtod(n, struct cmsghdr *);
- if (cm->cmsg_level == SOL_SOCKET &&
+ if (cm->cmsg_level == SOL_SOCKET &&
cm->cmsg_type == SCM_CREDS) {
- if (n_prev == NULL)
+ if (n_prev == NULL)
control = n->m_next;
else
n_prev->m_next = n->m_next;
@@ -2293,11 +2293,11 @@
{
struct unpcb *unp;
- if (!have_addr) {
- db_printf("usage: show unpcb <addr>\n");
- return;
- }
- unp = (struct unpcb *)addr;
+ if (!have_addr) {
+ db_printf("usage: show unpcb <addr>\n");
+ return;
+ }
+ unp = (struct unpcb *)addr;
db_printf("unp_socket: %p unp_vnode: %p\n", unp->unp_socket,
unp->unp_vnode);
Index: vfs_default.c
===================================================================
--- vfs_default.c (revision 210768)
+++ vfs_default.c (working copy)
@@ -625,8 +625,8 @@
/*
* MARK/SCAN initialization to avoid infinite loops.
*/
- TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) {
- bp->b_vflags &= ~BV_SCANNED;
+ TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) {
+ bp->b_vflags &= ~BV_SCANNED;
bp->b_error = 0;
}
Index: init_main.c
===================================================================
--- init_main.c (revision 210768)
+++ init_main.c (working copy)
@@ -710,7 +710,7 @@
options = 1;
}
#ifdef notyet
- if (boothowto & RB_FASTBOOT) {
+ if (boothowto & RB_FASTBOOT) {
(void)subyte(--ucp, 'f');
options = 1;
}
Index: uipc_socket.c
===================================================================
--- uipc_socket.c (revision 210768)
+++ uipc_socket.c (working copy)
@@ -1385,17 +1385,17 @@
else
sb->sb_mb = nextrecord;
- /*
+ /*
* Now update any dependent socket buffer fields to reflect the new
* state. This is an expanded inline of SB_EMPTY_FIXUP(), with the
* addition of a second clause that takes care of the case where
* sb_mb has been updated, but remains the last record.
*/
- if (sb->sb_mb == NULL) {
- sb->sb_mbtail = NULL;
- sb->sb_lastrecord = NULL;
- } else if (sb->sb_mb->m_nextpkt == NULL)
- sb->sb_lastrecord = sb->sb_mb;
+ if (sb->sb_mb == NULL) {
+ sb->sb_mbtail = NULL;
+ sb->sb_lastrecord = NULL;
+ } else if (sb->sb_mb->m_nextpkt == NULL)
+ sb->sb_lastrecord = sb->sb_mb;
}
@@ -1751,8 +1751,8 @@
*mp = m_copym(m, 0, len, copy_flag);
if (copy_flag == M_WAIT)
SOCKBUF_LOCK(&so->so_rcv);
- if (*mp == NULL) {
- /*
+ if (*mp == NULL) {
+ /*
* m_copym() couldn't
* allocate an mbuf. Adjust
* uio_resid back (it was
@@ -1760,9 +1760,9 @@
* bytes, which we didn't end
* up "copying" over).
*/
- uio->uio_resid += len;
- break;
- }
+ uio->uio_resid += len;
+ break;
+ }
}
m->m_data += len;
m->m_len -= len;
Index: kern_cons.c
===================================================================
--- kern_cons.c (revision 210768)
+++ kern_cons.c (working copy)
@@ -112,7 +112,7 @@
* once we are up and going.
*
*/
- cn_mute = ((boothowto & (RB_MUTE
+ cn_mute = ((boothowto & (RB_MUTE
|RB_SINGLE
|RB_VERBOSE
|RB_ASKNAME)) == RB_MUTE);
Index: imgact_elf.c
===================================================================
--- imgact_elf.c (revision 210768)
+++ imgact_elf.c (working copy)
@@ -645,11 +645,11 @@
/* Loadable segment */
prot = 0;
if (phdr[i].p_flags & PF_X)
- prot |= VM_PROT_EXECUTE;
+ prot |= VM_PROT_EXECUTE;
if (phdr[i].p_flags & PF_W)
- prot |= VM_PROT_WRITE;
+ prot |= VM_PROT_WRITE;
if (phdr[i].p_flags & PF_R)
- prot |= VM_PROT_READ;
+ prot |= VM_PROT_READ;
if ((error = __elfN(load_section)(vmspace,
imgp->object, phdr[i].p_offset,
@@ -662,7 +662,7 @@
* first segment.
*/
if (numsegs == 0)
- base_addr = trunc_page(phdr[i].p_vaddr +
+ base_addr = trunc_page(phdr[i].p_vaddr +
rbase);
numsegs++;
}
@@ -793,11 +793,11 @@
break;
prot = 0;
if (phdr[i].p_flags & PF_X)
- prot |= VM_PROT_EXECUTE;
+ prot |= VM_PROT_EXECUTE;
if (phdr[i].p_flags & PF_W)
- prot |= VM_PROT_WRITE;
+ prot |= VM_PROT_WRITE;
if (phdr[i].p_flags & PF_R)
- prot |= VM_PROT_READ;
+ prot |= VM_PROT_READ;
#if defined(__ia64__) && __ELF_WORD_SIZE == 32 && defined(IA32_ME_HARDER)
/*
@@ -1055,24 +1055,24 @@
hdr = NULL;
#ifdef COMPRESS_USER_CORES
- if (doing_compress) {
- p = gzopen_flags;
- *p++ = 'w';
- if (compress_user_cores_gzlevel >= 0 &&
- compress_user_cores_gzlevel <= 9)
- *p++ = '0' + compress_user_cores_gzlevel;
- *p = 0;
- gzfile = gz_open("", gzopen_flags, vp);
- if (gzfile == Z_NULL) {
- error = EFAULT;
- goto done;
- }
- core_buf = malloc(CORE_BUF_SIZE, M_TEMP, M_WAITOK | M_ZERO);
- if (!core_buf) {
- error = ENOMEM;
- goto done;
- }
- }
+ if (doing_compress) {
+ p = gzopen_flags;
+ *p++ = 'w';
+ if (compress_user_cores_gzlevel >= 0 &&
+ compress_user_cores_gzlevel <= 9)
+ *p++ = '0' + compress_user_cores_gzlevel;
+ *p = 0;
+ gzfile = gz_open("", gzopen_flags, vp);
+ if (gzfile == Z_NULL) {
+ error = EFAULT;
+ goto done;
+ }
+ core_buf = malloc(CORE_BUF_SIZE, M_TEMP, M_WAITOK | M_ZERO);
+ if (!core_buf) {
+ error = ENOMEM;
+ goto done;
+ }
+ }
#endif
/* Size the program segments. */
Index: subr_stack.c
===================================================================
--- subr_stack.c (revision 210768)
+++ subr_stack.c (working copy)
@@ -270,7 +270,7 @@
*name = symval.name;
return (0);
}
- out:
+out:
*offset = 0;
*name = "??";
return (ENOENT);
Index: subr_trap.c
===================================================================
--- subr_trap.c (revision 210768)
+++ subr_trap.c (working copy)
@@ -92,7 +92,7 @@
struct proc *p = td->td_proc;
CTR3(KTR_SYSC, "userret: thread %p (pid %d, %s)", td, p->p_pid,
- td->td_name);
+ td->td_name);
#if 0
#ifdef DIAGNOSTIC
/* Check that we called signotify() enough. */
@@ -149,7 +149,7 @@
p = td->td_proc;
CTR3(KTR_SYSC, "ast: thread %p (pid %d, %s)", td, p->p_pid,
- p->p_comm);
+ p->p_comm);
KASSERT(TRAPF_USERMODE(framep), ("ast in kernel mode"));
WITNESS_WARN(WARN_PANIC, NULL, "Returning to user mode");
mtx_assert(&Giant, MA_NOTOWNED);
@@ -336,7 +336,7 @@
CTR4(KTR_SYSC, "syscall: p=%p error=%d return %#lx %#lx",
p, error, td->td_retval[0], td->td_retval[1]);
}
- retval:
+retval:
if (traced) {
PROC_LOCK(p);
td->td_dbgflags &= ~TDB_SCE;
Index: sched_4bsd.c
===================================================================
--- sched_4bsd.c (revision 210768)
+++ sched_4bsd.c (working copy)
@@ -136,9 +136,9 @@
#endif
static struct kproc_desc sched_kp = {
- "schedcpu",
- schedcpu_thread,
- NULL
+ "schedcpu",
+ schedcpu_thread,
+ NULL
};
SYSINIT(schedcpu, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, kproc_start,
&sched_kp);
@@ -177,7 +177,7 @@
new_val = sched_quantum * tick;
error = sysctl_handle_int(oidp, &new_val, 0, req);
- if (error != 0 || req->newptr == NULL)
+ if (error != 0 || req->newptr == NULL)
return (error);
if (new_val < tick)
return (EINVAL);
@@ -984,7 +984,7 @@
KASSERT((newtd->td_inhibitors == 0),
("trying to run inhibited thread"));
newtd->td_flags |= TDF_DIDRUN;
- TD_SET_RUNNING(newtd);
+ TD_SET_RUNNING(newtd);
if ((newtd->td_flags & TDF_NOLOAD) == 0)
sched_load_add();
} else {
Index: kern_linker.c
===================================================================
--- kern_linker.c (revision 210768)
+++ kern_linker.c (working copy)
@@ -65,7 +65,7 @@
#ifdef KLD_DEBUG
int kld_debug = 0;
SYSCTL_INT(_debug, OID_AUTO, kld_debug, CTLFLAG_RW,
- &kld_debug, 0, "Set various levels of KLD debug");
+ &kld_debug, 0, "Set various levels of KLD debug");
#endif
#define KLD_LOCK() sx_xlock(&kld_sx)
Index: kern_cpu.c
===================================================================
--- kern_cpu.c (revision 210768)
+++ kern_cpu.c (working copy)
@@ -120,9 +120,9 @@
DEVMETHOD(device_attach, cpufreq_attach),
DEVMETHOD(device_detach, cpufreq_detach),
- DEVMETHOD(cpufreq_set, cf_set_method),
- DEVMETHOD(cpufreq_get, cf_get_method),
- DEVMETHOD(cpufreq_levels, cf_levels_method),
+ DEVMETHOD(cpufreq_set, cf_set_method),
+ DEVMETHOD(cpufreq_get, cf_get_method),
+ DEVMETHOD(cpufreq_levels, cf_levels_method),
{0, 0}
};
static driver_t cpufreq_driver = {
Index: sysv_shm.c
===================================================================
--- sysv_shm.c (revision 210768)
+++ sysv_shm.c (working copy)
@@ -293,7 +293,7 @@
return (ENOSYS);
mtx_lock(&Giant);
shmmap_s = p->p_vmspace->vm_shm;
- if (shmmap_s == NULL) {
+ if (shmmap_s == NULL) {
error = EINVAL;
goto done2;
}
Index: subr_msgbuf.c
===================================================================
--- subr_msgbuf.c (revision 210768)
+++ subr_msgbuf.c (working copy)
@@ -70,7 +70,7 @@
mbp->msg_seqmod = SEQMOD(size);
mbp->msg_wseq = MSGBUF_SEQNORM(mbp, mbp->msg_wseq);
mbp->msg_rseq = MSGBUF_SEQNORM(mbp, mbp->msg_rseq);
- mbp->msg_ptr = ptr;
+ mbp->msg_ptr = ptr;
cksum = msgbuf_cksum(mbp);
if (cksum != mbp->msg_cksum) {
if (bootverbose) {
Index: subr_module.c
===================================================================
--- subr_module.c (revision 210768)
+++ subr_module.c (working copy)
@@ -46,7 +46,7 @@
caddr_t curp;
uint32_t *hdr;
int next;
-
+
if (preload_metadata != NULL) {
curp = preload_metadata;
@@ -115,7 +115,7 @@
caddr_t curp;
uint32_t *hdr;
int next;
-
+
if (preload_metadata != NULL) {
/* Pick up where we left off last time */
@@ -202,7 +202,7 @@
uint32_t *hdr;
int next;
int clearing;
-
+
if (preload_metadata != NULL) {
clearing = 0;
@@ -238,7 +238,7 @@
uint32_t *hdr;
vm_offset_t *ptr;
int next;
-
+
if (preload_metadata != NULL) {
curp = preload_metadata;
Index: tty.c
===================================================================
--- tty.c (revision 210768)
+++ tty.c (working copy)
@@ -468,10 +468,10 @@
if (error)
goto done;
}
-
- tp->t_flags |= TF_BUSY_OUT;
+
+ tp->t_flags |= TF_BUSY_OUT;
error = ttydisc_write(tp, uio, ioflag);
- tp->t_flags &= ~TF_BUSY_OUT;
+ tp->t_flags &= ~TF_BUSY_OUT;
cv_signal(&tp->t_outserwait);
}
Index: vfs_mount.c
===================================================================
--- vfs_mount.c (revision 210768)
+++ vfs_mount.c (working copy)
@@ -985,7 +985,7 @@
* XXX The final recipients of VFS_MOUNT just overwrite the ndp they
* get. No freeing of cn_pnbuf.
*/
- error = VFS_MOUNT(mp);
+ error = VFS_MOUNT(mp);
/*
* Process the export option only if we are
Index: link_elf.c
===================================================================
--- link_elf.c (revision 210768)
+++ link_elf.c (working copy)
@@ -1505,9 +1505,9 @@
link_elf_symtab_get(linker_file_t lf, const Elf_Sym **symtab)
{
elf_file_t ef = (elf_file_t)lf;
-
+
*symtab = ef->ddbsymtab;
-
+
if (*symtab == NULL)
return (0);
Index: kern_malloc.c
===================================================================
--- kern_malloc.c (revision 210768)
+++ kern_malloc.c (working copy)
@@ -627,7 +627,7 @@
uint8_t indx;
u_long mem_size;
int i;
-
+
mtx_init(&malloc_mtx, "malloc", NULL, MTX_DEF);
/*
Index: kern_gzio.c
===================================================================
--- kern_gzio.c (revision 210768)
+++ kern_gzio.c (working copy)
@@ -146,7 +146,7 @@
log(LOG_ERR, "gz_open: mode is not w (%c)\n", s->mode);
return destroy(s), (gzFile)Z_NULL;
}
-
+
err = deflateInit2(&(s->stream), level,
Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy);
/* windowBits is passed < 0 to suppress zlib header */
@@ -173,7 +173,7 @@
}
s->outoff += GZ_HEADER_LEN;
s->startpos = 10L;
-
+
return (gzFile)s;
}
@@ -313,7 +313,7 @@
* all the available space in the output buffer:
*/
done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END);
-
+
if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break;
}
s->outoff = curoff;
@@ -397,7 +397,7 @@
MALLOC(ptr, void *, items * size, M_TEMP, M_NOWAIT | M_ZERO);
return ptr;
}
-
+
static void
gz_free(void *opaque __unused, void *ptr)
{
Index: kern_fail.c
===================================================================
--- kern_fail.c (revision 210768)
+++ kern_fail.c (working copy)
@@ -341,7 +341,7 @@
FP_UNLOCK();
- end:
+end:
#ifdef IWARNING
if (error)
IWARNING("Failed to set %s (%s) to %s",
@@ -390,7 +390,7 @@
buf[req->newlen] = '\0';
error = fail_point_set(fp, buf);
- }
+ }
out:
if (buf)
Index: kern_event.c
===================================================================
--- kern_event.c (revision 210768)
+++ kern_event.c (working copy)
@@ -658,7 +658,7 @@
}
break;
- case EVENT_PROCESS:
+ case EVENT_PROCESS:
*kev = kn->kn_kevent;
kev->fflags = kn->kn_sfflags;
kev->data = kn->kn_sdata;
Index: uipc_sem.c
===================================================================
--- uipc_sem.c (revision 210768)
+++ uipc_sem.c (working copy)
@@ -983,16 +983,16 @@
static int
sem_modload(struct module *module, int cmd, void *arg)
{
- int error = 0;
+ int error = 0;
- switch (cmd) {
- case MOD_LOAD:
+ switch (cmd) {
+ case MOD_LOAD:
error = ksem_module_init();
if (error)
ksem_module_destroy();
- break;
+ break;
- case MOD_UNLOAD:
+ case MOD_UNLOAD:
mtx_lock(&ksem_count_lock);
if (nsems != 0) {
error = EOPNOTSUPP;
@@ -1002,21 +1002,21 @@
ksem_dead = 1;
mtx_unlock(&ksem_count_lock);
ksem_module_destroy();
- break;
+ break;
- case MOD_SHUTDOWN:
- break;
- default:
- error = EINVAL;
- break;
- }
- return (error);
+ case MOD_SHUTDOWN:
+ break;
+ default:
+ error = EINVAL;
+ break;
+ }
+ return (error);
}
static moduledata_t sem_mod = {
- "sem",
- &sem_modload,
- NULL
+ "sem",
+ &sem_modload,
+ NULL
};
DECLARE_MODULE(sem, sem_mod, SI_SUB_SYSV_SEM, SI_ORDER_FIRST);
Index: kern_sx.c
===================================================================
--- kern_sx.c (revision 210768)
+++ kern_sx.c (working copy)
@@ -185,7 +185,7 @@
uintptr_t x = sx->sx_lock;
*owner = (struct thread *)SX_OWNER(x);
- return ((x & SX_LOCK_SHARED) != 0 ? (SX_SHARERS(x) != 0) :
+ return ((x & SX_LOCK_SHARED) != 0 ? (SX_SHARERS(x) != 0) :
(*owner != NULL));
}
#endif
Index: bus_if.m
===================================================================
--- bus_if.m (revision 210768)
+++ bus_if.m (working copy)
@@ -87,8 +87,8 @@
* @param _child the child device which failed to probe
*/
METHOD void probe_nomatch {
- device_t _dev;
- device_t _child;
+ device_t _dev;
+ device_t _child;
};
/**
Index: subr_power.c
===================================================================
--- subr_power.c (revision 210768)
+++ subr_power.c (working copy)
@@ -103,7 +103,7 @@
power_profile_set_state(int state)
{
int changed;
-
+
if (state != power_profile_state) {
power_profile_state = state;
changed = 1;
Index: kern_prot.c
===================================================================
--- kern_prot.c (revision 210768)
+++ kern_prot.c (working copy)
@@ -107,7 +107,7 @@
#ifndef _SYS_SYSPROTO_H_
struct getppid_args {
- int dummy;
+ int dummy;
};
#endif
/* ARGSUSED */
@@ -127,7 +127,7 @@
*/
#ifndef _SYS_SYSPROTO_H_
struct getpgrp_args {
- int dummy;
+ int dummy;
};
#endif
int
@@ -205,7 +205,7 @@
#ifndef _SYS_SYSPROTO_H_
struct getuid_args {
- int dummy;
+ int dummy;
};
#endif
/* ARGSUSED */
@@ -222,7 +222,7 @@
#ifndef _SYS_SYSPROTO_H_
struct geteuid_args {
- int dummy;
+ int dummy;
};
#endif
/* ARGSUSED */
@@ -236,7 +236,7 @@
#ifndef _SYS_SYSPROTO_H_
struct getgid_args {
- int dummy;
+ int dummy;
};
#endif
/* ARGSUSED */
@@ -258,7 +258,7 @@
*/
#ifndef _SYS_SYSPROTO_H_
struct getegid_args {
- int dummy;
+ int dummy;
};
#endif
/* ARGSUSED */
@@ -322,7 +322,7 @@
#ifndef _SYS_SYSPROTO_H_
struct setsid_args {
- int dummy;
+ int dummy;
};
#endif
/* ARGSUSED */
Index: kern_descrip.c
===================================================================
--- kern_descrip.c (revision 210768)
+++ kern_descrip.c (working copy)
@@ -218,8 +218,8 @@
static int
fdisused(struct filedesc *fdp, int fd)
{
- KASSERT(fd >= 0 && fd < fdp->fd_nfiles,
- ("file descriptor %d out of range (0, %d)", fd, fdp->fd_nfiles));
+ KASSERT(fd >= 0 && fd < fdp->fd_nfiles,
+ ("file descriptor %d out of range (0, %d)", fd, fdp->fd_nfiles));
return ((fdp->fd_map[NDSLOT(fd)] & NDBIT(fd)) != 0);
}
@@ -369,13 +369,13 @@
}
arg = (intptr_t)&fl;
break;
- case F_GETLK:
- case F_SETLK:
- case F_SETLKW:
+ case F_GETLK:
+ case F_SETLK:
+ case F_SETLKW:
case F_SETLK_REMOTE:
error = copyin((void *)(intptr_t)uap->arg, &fl, sizeof(fl));
- arg = (intptr_t)&fl;
- break;
+ arg = (intptr_t)&fl;
+ break;
default:
arg = uap->arg;
break;
Index: kern_lock.c
===================================================================
--- kern_lock.c (revision 210768)
+++ kern_lock.c (working copy)
@@ -371,8 +371,8 @@
MPASS((flags & ~LK_INIT_MASK) == 0);
ASSERT_ATOMIC_LOAD_PTR(lk->lk_lock,
- ("%s: lockmgr not aligned for %s: %p", __func__, wmesg,
- &lk->lk_lock));
+ ("%s: lockmgr not aligned for %s: %p", __func__, wmesg,
+ &lk->lk_lock));
iflags = LO_SLEEPABLE | LO_UPGRADABLE;
if (flags & LK_CANRECURSE)
Index: uipc_cow.c
===================================================================
--- uipc_cow.c (revision 210768)
+++ uipc_cow.c (working copy)
@@ -116,9 +116,9 @@
if (vm_fault_quick((caddr_t)uva, VM_PROT_READ) < 0)
return (0);
- /*
- * verify page is mapped & not already wired for i/o
- */
+ /*
+ * verify page is mapped & not already wired for i/o
+ */
pp = pmap_extract_and_hold(map->pmap, uva, VM_PROT_READ);
if (pp == NULL) {
socow_stats.fail_not_mapped++;
Index: uipc_mbuf.c
===================================================================
--- uipc_mbuf.c (revision 210768)
+++ uipc_mbuf.c (working copy)
@@ -1103,7 +1103,7 @@
}
m->m_next = n;
return (m);
- bad:
+bad:
m_freem(n);
MSFail++;
return (NULL);
@@ -2098,16 +2098,16 @@
mbprof_clr_handler(SYSCTL_HANDLER_ARGS)
{
int clear, error;
-
+
clear = 0;
error = sysctl_handle_int(oidp, &clear, 0, req);
if (error || !req->newptr)
return (error);
-
+
if (clear) {
bzero(&mbprof, sizeof(mbprof));
}
-
+
return (error);
}
Index: kern_alq.c
===================================================================
--- kern_alq.c (revision 210768)
+++ kern_alq.c (working copy)
@@ -414,9 +414,9 @@
}
static struct kproc_desc ald_kp = {
- "ALQ Daemon",
- ald_daemon,
- &ald_proc
+ "ALQ Daemon",
+ ald_daemon,
+ &ald_proc
};
SYSINIT(aldthread, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, kproc_start, &ald_kp);
Index: imgact_aout.c
===================================================================
--- imgact_aout.c (revision 210768)
+++ imgact_aout.c (working copy)
@@ -127,7 +127,7 @@
if (((a_out->a_magic >> 16) & 0xff) != 0x86 &&
((a_out->a_magic >> 16) & 0xff) != 0 &&
((((int)ntohl(a_out->a_magic)) >> 16) & 0xff) != 0x86)
- return -1;
+ return -1;
/*
* Set file/virtual offset based on a.out variant.
Index: kern_sysctl.c
===================================================================
--- kern_sysctl.c (revision 210768)
+++ kern_sysctl.c (working copy)
@@ -1199,8 +1199,8 @@
kernel_sysctlbyname(struct thread *td, char *name, void *old, size_t *oldlenp,
void *new, size_t newlen, size_t *retval, int flags)
{
- int oid[CTL_MAXNAME];
- size_t oidlen, plen;
+ int oid[CTL_MAXNAME];
+ size_t oidlen, plen;
int error;
oid[0] = 0; /* sysctl internal magic */
@@ -1442,7 +1442,7 @@
return (EINVAL);
error = copyin(uap->name, &name, uap->namelen * sizeof(int));
- if (error)
+ if (error)
return (error);
error = userland_sysctl(td, name, uap->namelen,
Index: kern_module.c
===================================================================
--- kern_module.c (revision 210768)
+++ kern_module.c (working copy)
@@ -234,14 +234,14 @@
module_t
module_lookupbyid(int modid)
{
- module_t mod;
+ module_t mod;
- MOD_LOCK_ASSERT;
+ MOD_LOCK_ASSERT;
- TAILQ_FOREACH(mod, &modules, link)
- if (mod->id == modid)
- return(mod);
- return (NULL);
+ TAILQ_FOREACH(mod, &modules, link)
+ if (mod->id == modid)
+ return(mod);
+ return (NULL);
}
int
Index: subr_witness.c
===================================================================
--- subr_witness.c (revision 210768)
+++ subr_witness.c (working copy)
@@ -914,16 +914,16 @@
{
int i;
- for (i = 0; i < indent; i++)
- prnt(" ");
+ for (i = 0; i < indent; i++)
+ prnt(" ");
prnt("%s (type: %s, depth: %d, active refs: %d)",
w->w_name, w->w_class->lc_name,
w->w_ddb_level, w->w_refcount);
- if (w->w_displayed) {
- prnt(" -- (already displayed)\n");
- return;
- }
- w->w_displayed = 1;
+ if (w->w_displayed) {
+ prnt(" -- (already displayed)\n");
+ return;
+ }
+ w->w_displayed = 1;
if (w->w_file != NULL && w->w_line != 0)
prnt(" -- last acquired @ %s:%d\n", w->w_file,
w->w_line);
@@ -2479,10 +2479,10 @@
tmp_w1->w_name, tmp_w1->w_class->lc_name,
tmp_w2->w_name, tmp_w2->w_class->lc_name);
#if 0
- sbuf_printf(sb,
+ sbuf_printf(sb,
"w_rmatrix[%s][%s] == %x, w_rmatrix[%s][%s] == %x\n",
- tmp_w1->name, tmp_w2->w_name, w_rmatrix1,
- tmp_w2->name, tmp_w1->w_name, w_rmatrix2);
+ tmp_w1->name, tmp_w2->w_name, w_rmatrix1,
+ tmp_w2->name, tmp_w1->w_name, w_rmatrix2);
#endif
if (data1) {
sbuf_printf(sb,
Index: vfs_subr.c
===================================================================
--- vfs_subr.c (revision 210768)
+++ vfs_subr.c (working copy)
@@ -821,7 +821,7 @@
};
SYSINIT(vnlru, SI_SUB_KTHREAD_UPDATE, SI_ORDER_FIRST, kproc_start,
&vnlru_kp);
-
+
/*
* Routines having to do with the management of the vnode table.
*/
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=E%2Bzg5rNSv0Dg6uG%2Baxxvz=vrRVdug0JiNhbHG>
