kern: clean up empty lines in .c and .h files

This commit is contained in:
Mateusz Guzik 2020-09-01 22:12:32 +00:00
parent ab326db897
commit 6fed89b179
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=365222
76 changed files with 73 additions and 148 deletions

View File

@ -908,7 +908,7 @@ __elfN(enforce_limits)(struct image_params *imgp, const Elf_Ehdr *hdr,
}
total_size += seg_size;
}
if (data_addr == 0 && data_size == 0) {
data_addr = text_addr;
data_size = text_size;

View File

@ -277,7 +277,6 @@ mi_startup(void)
* Perform each task, and continue on to the next task.
*/
for (sipp = sysinit; sipp < sysinit_end; sipp++) {
if ((*sipp)->subsystem == SI_SUB_DUMMY)
continue; /* skip dummy task(s)*/
@ -723,7 +722,7 @@ start_init(void *dummy)
freeenv(var);
}
free_init_path = tmp_init_path = strdup(init_path, M_TEMP);
while ((path = strsep(&tmp_init_path, ":")) != NULL) {
if (bootverbose)
printf("start_init: trying %s\n", path);

View File

@ -635,7 +635,6 @@ acct_thread(void *dummy)
/* Loop until we are asked to exit. */
while (!(acct_state & ACCT_EXITREQ)) {
/* Perform our periodic checks. */
acctwatch();

View File

@ -923,7 +923,7 @@ static int
alq_load_handler(module_t mod, int what, void *arg)
{
int ret;
ret = 0;
switch (what) {

View File

@ -229,7 +229,6 @@ deadlres_td_sleep_q(struct proc *p, struct thread *td, int slpticks)
slptype = sleepq_type(wchan);
if ((slptype == SLEEPQ_SX || slptype == SLEEPQ_LK) &&
tticks > slpticks) {
/*
* Accordingly with provided thresholds, this thread is stuck
* for too long on a sleepqueue.

View File

@ -664,7 +664,7 @@ prep_cdevsw(struct cdevsw *devsw, int flags)
devsw->d_dump = dead_dump;
devsw->d_kqfilter = dead_kqfilter;
}
if (devsw->d_flags & D_NEEDGIANT) {
printf("WARNING: Device \"%s\" is Giant locked and may be "
"deleted before FreeBSD 13.0.\n",
@ -1399,7 +1399,7 @@ clone_cleanup(struct clonedevs **cdp)
struct cdev *dev;
struct cdev_priv *cp;
struct clonedevs *cd;
cd = *cdp;
if (cd == NULL)
return;

View File

@ -779,4 +779,3 @@ vty_set_preferred(unsigned vty)
vty_prefer &= ~VTY_VT;
#endif
}

View File

@ -695,7 +695,6 @@ cf_levels_method(device_t dev, struct cf_level *levels, int *count)
/* Finally, output the list of levels. */
i = 0;
TAILQ_FOREACH(lev, &sc->all_levels, link) {
/* Skip levels that have a frequency that is too low. */
if (lev->total_set.freq < cf_lowest_freq) {
sc->all_count--;

View File

@ -488,7 +488,7 @@ _domainset_create(struct domainset *domain, struct domainlist *freelist)
else
uma_zfree(domainset_zone, domain);
return (ndomain);
}
/*
@ -1893,7 +1893,6 @@ kern_cpuset_setaffinity(struct thread *td, cpulevel_t level, cpuwhich_t which,
error = EINVAL;
goto out;
}
}
switch (level) {
case CPU_LEVEL_ROOT:
@ -2148,7 +2147,6 @@ kern_cpuset_setdomain(struct thread *td, cpulevel_t level, cpuwhich_t which,
error = EINVAL;
goto out;
}
}
DOMAINSET_COPY(mask, &domain.ds_mask);
domain.ds_policy = policy;

View File

@ -696,7 +696,6 @@ getenv_array(const char *name, void *pdata, int size, int *psize,
n = 0;
for (ptr = buf; *ptr != 0; ) {
value = strtoq(ptr, &end, 0);
/* check if signed numbers are allowed */

View File

@ -268,4 +268,3 @@ sysctl_kern_eventtimer_choice(SYSCTL_HANDLER_ARGS)
SYSCTL_PROC(_kern_eventtimer, OID_AUTO, choice,
CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE,
0, 0, sysctl_kern_eventtimer_choice, "A", "Present event timers");

View File

@ -1561,7 +1561,7 @@ kqueue_register(struct kqueue *kq, struct kevent *kev, struct thread *td,
goto done;
}
}
if (kev->flags & EV_DELETE) {
kn_enter_flux(kn);
KQ_UNLOCK(kq);

View File

@ -563,7 +563,6 @@ fail_point_eval_nontrivial(struct fail_point *fp, int *return_value)
goto abort;
TAILQ_FOREACH(ent, &fp_setting->fp_entry_queue, fe_entries) {
if (ent->fe_stale)
continue;

View File

@ -704,7 +704,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread *
procdesc_finit(p2->p_procdesc, fp_procdesc);
fdrop(fp_procdesc, td);
}
/*
* Speculative check for PTRACE_FORK. PTRACE_FORK is not
* synced with forks in progress so it is OK if we miss it

View File

@ -3173,7 +3173,6 @@ prison_priv_check(struct ucred *cred, int priv)
#endif /* VIMAGE */
switch (priv) {
/*
* Allow ktrace privileges for root in jail.
*/

View File

@ -419,7 +419,7 @@ static int db_mach_vtrace(void);
DB_SHOW_COMMAND(ktr, db_ktr_all)
{
tstate.cur = (ktr_idx - 1) % ktr_entries;
tstate.first = -1;
db_ktr_verbose = 0;

View File

@ -480,7 +480,6 @@ linker_load_file(const char *filename, linker_file_t *result)
* the module was not found.
*/
if (foundfile) {
/*
* If the file type has not been recognized by the last try
* printout a message before to fail.
@ -668,7 +667,6 @@ linker_file_unload(linker_file_t file, int flags)
MOD_SLOCK;
for (mod = TAILQ_FIRST(&file->modules); mod;
mod = module_getfnext(mod)) {
error = module_quiesce(mod);
if (error != 0 && flags != LINKER_UNLOAD_FORCE) {
KLD_DPF(FILE, ("linker_file_unload: module %s"
@ -2044,7 +2042,6 @@ linker_hwpmc_list_objects(void)
M_LINKER, M_WAITOK | M_ZERO);
i = 0;
TAILQ_FOREACH(lf, &linker_files, link) {
/* Save the info for this linker file. */
kobase[i].pm_file = lf->filename;
kobase[i].pm_address = (uintptr_t)lf->address;

View File

@ -364,7 +364,6 @@ wakeupshlk(struct lock *lk, const char *file, int line)
}
} else {
/*
* Exclusive waiters sleeping with LK_SLEEPFAIL on
* and using interruptible sleeps/timeout may have
@ -1186,7 +1185,6 @@ lockmgr_xunlock_hard(struct lock *lk, uintptr_t x, u_int flags, struct lock_obje
queue = SQ_SHARED_QUEUE;
}
} else {
/*
* Exclusive waiters sleeping with LK_SLEEPFAIL
* on and using interruptible sleeps/timeout
@ -1486,7 +1484,6 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk,
queue = SQ_EXCLUSIVE_QUEUE;
v &= ~LK_EXCLUSIVE_WAITERS;
} else {
/*
* Exclusive waiters sleeping with
* LK_SLEEPFAIL on and using

View File

@ -441,7 +441,6 @@ lf_advlockasync(struct vop_advlockasync_args *ap, struct lockf **statep,
* Convert the flock structure into a start and end.
*/
switch (fl->l_whence) {
case SEEK_SET:
case SEEK_CUR:
/*
@ -2440,7 +2439,7 @@ graph_free_vertex(struct owner_graph *g, struct owner_vertex *v)
int i;
sx_assert(&lf_owner_graph_lock, SX_XLOCKED);
KASSERT(LIST_EMPTY(&v->v_outedges), ("Freeing vertex with edges"));
KASSERT(LIST_EMPTY(&v->v_inedges), ("Freeing vertex with edges"));

View File

@ -1108,7 +1108,6 @@ mallocinit(void *dummy)
}
for (;i <= size; i+= KMEM_ZBASE)
kmemsize[i >> KMEM_ZSHIFT] = indx;
}
}
SYSINIT(kmem, SI_SUB_KMEM, SI_ORDER_SECOND, mallocinit, NULL);
@ -1260,7 +1259,6 @@ sysctl_kern_malloc_stats(SYSCTL_HANDLER_ARGS)
for (; i < MAXCPU; i++) {
(void)sbuf_bcat(&sbuf, &zeromts, sizeof(zeromts));
}
}
mtx_unlock(&malloc_mtx);
error = sbuf_finish(&sbuf);

View File

@ -1427,7 +1427,6 @@ m_getm2(struct mbuf *m, int len, int how, short type, int flags)
if (len > MCLBYTES) {
mb = m_getjcl(M_NOWAIT, type, (flags & M_PKTHDR),
MJUMPAGESIZE);
}
if (mb == NULL) {
if (len >= MINCLSIZE)

View File

@ -200,7 +200,7 @@ module_release(module_t mod)
panic("module_release: bad reference count");
MOD_DPF(REFS, ("module_release: before, refs=%d\n", mod->refs));
mod->refs--;
if (mod->refs == 0) {
TAILQ_REMOVE(&modules, mod, link);

View File

@ -514,7 +514,6 @@ ntp_update_second(int64_t *adjustment, time_t *newsec)
* is always monotonic.
*/
switch (time_state) {
/*
* No warning.
*/
@ -588,7 +587,7 @@ ntp_update_second(int64_t *adjustment, time_t *newsec)
time_adj = ftemp;
L_SUB(time_offset, ftemp);
L_ADD(time_adj, time_freq);
/*
* Apply any correction from adjtime(2). If more than one second
* off we slew at a rate of 5ms/s (5000 PPM) else 500us/s (500PPM)

View File

@ -364,4 +364,3 @@ init_hwpmc(void *dummy __unused)
}
SYSINIT(hwpmc, SI_SUB_KDTRACE, SI_ORDER_FIRST, init_hwpmc, NULL);

View File

@ -1613,7 +1613,6 @@ sysctl_kern_proc_iterate(struct proc *p, void *origarg)
* do by session.
*/
switch (oid_number) {
case KERN_PROC_GID:
if (p->p_ucred->cr_gid != (gid_t)name[0])
goto skip;
@ -1667,7 +1666,6 @@ sysctl_kern_proc_iterate(struct proc *p, void *origarg)
default:
break;
}
error = sysctl_out_proc(p, req, flags);
PROC_LOCK_ASSERT(p, MA_NOTOWNED);

View File

@ -1381,7 +1381,7 @@ int
cr_canseeothergids(struct ucred *u1, struct ucred *u2)
{
int i, match;
if (!see_other_gids) {
match = 0;
for (i = 0; i < u1->cr_ngroups; i++) {
@ -2227,7 +2227,7 @@ crsetgroups_locked(struct ucred *cr, int ngrp, gid_t *groups)
int i;
int j;
gid_t g;
KASSERT(cr->cr_agroups >= ngrp, ("cr_ngroups is too small"));
bcopy(groups, cr->cr_groups, ngrp * sizeof(gid_t));

View File

@ -528,7 +528,7 @@ racct_adjust_resource(struct racct *racct, int resource,
("%s: resource %d usage < 0", __func__, resource));
racct->r_resources[resource] = 0;
}
/*
* There are some cases where the racct %cpu resource would grow
* beyond 100% per core. For example in racct_proc_exit() we add

View File

@ -1063,16 +1063,16 @@ static void
rctl_rule_free(void *context, int pending)
{
struct rctl_rule *rule;
rule = (struct rctl_rule *)context;
ASSERT_RACCT_ENABLED();
KASSERT(rule->rr_refcount == 0, ("rule->rr_refcount != 0"));
/*
* We don't need locking here; rule is guaranteed to be inaccessible.
*/
rctl_rule_release_subject(rule);
uma_zfree(rctl_rule_zone, rule);
}
@ -2021,7 +2021,7 @@ rctl_proc_ucred_changed(struct proc *p, struct ucred *newcred)
rulecnt--;
}
}
LIST_FOREACH(link, &newuip->ui_racct->r_rule_links, rrl_next) {
if (newlink == NULL)
goto goaround;
@ -2208,35 +2208,35 @@ rctl_init(void)
int
sys_rctl_get_racct(struct thread *td, struct rctl_get_racct_args *uap)
{
return (ENOSYS);
}
int
sys_rctl_get_rules(struct thread *td, struct rctl_get_rules_args *uap)
{
return (ENOSYS);
}
int
sys_rctl_get_limits(struct thread *td, struct rctl_get_limits_args *uap)
{
return (ENOSYS);
}
int
sys_rctl_add_rule(struct thread *td, struct rctl_add_rule_args *uap)
{
return (ENOSYS);
}
int
sys_rctl_remove_rule(struct thread *td, struct rctl_remove_rule_args *uap)
{
return (ENOSYS);
}

View File

@ -105,7 +105,6 @@ kern_getpriority(struct thread *td, int which, int who)
error = 0;
low = PRIO_MAX + 1;
switch (which) {
case PRIO_PROCESS:
if (who == 0)
low = td->td_proc->p_nice;
@ -691,7 +690,6 @@ kern_proc_setrlimit(struct thread *td, struct proc *p, u_int which,
alimp = &newlim->pl_rlimit[which];
switch (which) {
case RLIMIT_CPU:
if (limp->rlim_cur != RLIM_INFINITY &&
p->p_cpulimit == RLIM_INFINITY)

View File

@ -1313,7 +1313,7 @@ sendfile(struct thread *td, struct sendfile_args *uap, int compat)
int
sys_sendfile(struct thread *td, struct sendfile_args *uap)
{
return (sendfile(td, uap, 0));
}

View File

@ -2961,7 +2961,6 @@ issignal(struct thread *td)
* to clear it from the pending mask.
*/
switch ((intptr_t)p->p_sigacts->ps_sigact[_SIG_IDX(sig)]) {
case (intptr_t)SIG_DFL:
/*
* Don't take default actions on system processes.

View File

@ -970,7 +970,6 @@ sysctl_sysctl_debug_dump_node(struct sysctl_oid_list *l, int i)
SYSCTL_ASSERT_LOCKED();
SLIST_FOREACH(oidp, l, oid_link) {
for (k=0; k<i; k++)
printf(" ");
@ -1007,7 +1006,6 @@ sysctl_sysctl_debug_dump_node(struct sysctl_oid_list *l, int i)
case CTLTYPE_OPAQUE: printf(" Opaque/struct\n"); break;
default: printf("\n");
}
}
}

View File

@ -1212,10 +1212,10 @@ kern_ktimer_create(struct thread *td, clockid_t clock_id, struct sigevent *evp,
!_SIG_VALID(evp->sigev_signo))
return (EINVAL);
}
if (p->p_itimers == NULL)
itimers_alloc(p);
it = uma_zalloc(itimer_zone, M_WAITOK);
it->it_flags = 0;
it->it_usecount = 0;
@ -1491,7 +1491,7 @@ static int
realtimer_delete(struct itimer *it)
{
mtx_assert(&it->it_mtx, MA_OWNED);
/*
* clear timer's value and interval to tell realtimer_expire
* to not rearm the timer.
@ -1545,7 +1545,7 @@ realtimer_settime(struct itimer *it, int flags,
} else {
timespecclear(&val.it_interval);
}
if (ovalue != NULL)
realtimer_gettime(it, ovalue);

View File

@ -654,7 +654,7 @@ softclock_call_cc(struct callout *c, struct callout_cpu *cc,
c_arg = c->c_arg;
c_iflags = c->c_iflags;
c->c_iflags &= ~CALLOUT_PENDING;
cc_exec_curr(cc, direct) = c;
cc_exec_last_func(cc, direct) = c_func;
cc_exec_last_arg(cc, direct) = c_arg;

View File

@ -173,7 +173,6 @@ ogetkerninfo(struct thread *td, struct ogetkerninfo_args *uap)
u_int needed = 0;
switch (uap->op & 0xff00) {
case KINFO_RT:
name[0] = CTL_NET;
name[1] = PF_ROUTE;

View File

@ -213,7 +213,6 @@ elf_set_add(struct elf_set_head *list, Elf_Addr start, Elf_Addr stop, Elf_Addr b
set->es_base = base;
TAILQ_FOREACH(iter, list, es_link) {
KASSERT((set->es_start < iter->es_start && set->es_stop < iter->es_stop) ||
(set->es_start > iter->es_start && set->es_stop > iter->es_stop),
("linker sets intersection: to insert: 0x%jx-0x%jx; inserted: 0x%jx-0x%jx",

View File

@ -1457,7 +1457,7 @@ link_elf_each_function_name(linker_file_t file,
elf_file_t ef = (elf_file_t)file;
const Elf_Sym *symp;
int i, error;
/* Exhaustive search */
for (i = 0, symp = ef->ddbsymtab; i < ef->ddbsymcnt; i++, symp++) {
if (symp->st_value != 0 &&

View File

@ -176,4 +176,3 @@ p31b_set_standard(void *dummy)
SYSINIT(p31b_set_standard, SI_SUB_P1003_1B, SI_ORDER_ANY, p31b_set_standard,
NULL);

View File

@ -1262,7 +1262,7 @@ sched_pickcpu(struct thread *td)
CPU_FOREACH(cpu) {
if (!THREAD_CAN_SCHED(td, cpu))
continue;
if (best == NOCPU)
best = cpu;
else if (runq_length[cpu] < runq_length[best])
@ -1311,7 +1311,6 @@ sched_add(struct thread *td, int flags)
td->td_lock = &sched_lock;
else
thread_lock_set(td, &sched_lock);
}
TD_SET_RUNQ(td);
@ -1629,7 +1628,7 @@ sched_pctcpu_delta(struct thread *td)
u_int
sched_estcpu(struct thread *td)
{
return (td_get_sched(td)->ts_estcpu);
}

View File

@ -650,7 +650,7 @@ blst_next_leaf_alloc(blmeta_t *scan, daddr_t start, int count, int maxcount)
}
}
}
/*
* 'scan' is the last leaf that provides blocks. Clear from 1 to
* BLIST_RADIX bits to represent the allocation of those last blocks.

View File

@ -42,7 +42,7 @@ buf_ring_alloc(int count, struct malloc_type *type, int flags, struct mtx *lock)
struct buf_ring *br;
KASSERT(powerof2(count), ("buf ring must be size power of 2"));
br = malloc(sizeof(struct buf_ring) + count*sizeof(caddr_t),
type, flags|M_ZERO);
if (br == NULL)

View File

@ -169,7 +169,6 @@ static bool device_frozen;
static int bus_debug = 1;
SYSCTL_INT(_debug, OID_AUTO, bus_debug, CTLFLAG_RWTUN, &bus_debug, 0,
"Bus debug level");
#define PDEBUG(a) if (bus_debug) {printf("%s:%d: ", __func__, __LINE__), printf a; printf("\n");}
#define DEVICENAME(d) ((d)? device_get_name(d): "no device")
@ -1921,7 +1920,7 @@ device_delete_child(device_t dev, device_t child)
/* detach parent before deleting children, if any */
if ((error = device_detach(child)) != 0)
return (error);
/* remove children second */
while ((grandchild = TAILQ_FIRST(&child->children)) != NULL) {
error = device_delete_child(child, grandchild);

View File

@ -171,4 +171,3 @@ busdma_bufalloc_free_uncacheable(void *item, vm_size_t size, uint8_t pflag)
kmem_free((vm_offset_t)item, size);
}

View File

@ -113,7 +113,7 @@ sysctl_handle_counter_u64_array(SYSCTL_HANDLER_ARGS)
*/
for (int i = 0; i < arg2; i++)
counter_u64_zero(((counter_u64_t *)arg1)[i]);
return (0);
}

View File

@ -878,4 +878,3 @@ CSAN_BUS_SET_FUNC(multi_stream, 8, uint64_t)
CSAN_BUS_SET_FUNC(region_stream, 8, uint64_t)
#endif
#endif

View File

@ -348,4 +348,3 @@ DB_SHOW_COMMAND(devmap, db_show_devmap)
}
#endif /* DDB */

View File

@ -76,7 +76,7 @@ setup_time_filter(struct time_filter *tf, int fil_type, uint32_t time_len)
{
uint64_t set_val;
int i;
/*
* You must specify either a MIN or MAX filter,
* though its up to the user to use the correct
@ -107,7 +107,7 @@ setup_time_filter_small(struct time_filter_small *tf, int fil_type, uint32_t tim
{
uint32_t set_val;
int i;
/*
* You must specify either a MIN or MAX filter,
* though its up to the user to use the correct
@ -333,7 +333,6 @@ tick_filter_clock(struct time_filter *tf, uint32_t now)
tf->entries[i].value = tf->entries[(i+1)].value;
tf->entries[i].time_up = tf->entries[(i+1)].time_up;
}
}
}
@ -365,7 +364,6 @@ tick_filter_clock_small(struct time_filter_small *tf, uint32_t now)
tf->entries[i].value = tf->entries[(i+1)].value;
tf->entries[i].time_up = tf->entries[(i+1)].time_up;
}
}
}
@ -373,7 +371,7 @@ uint32_t
apply_filter_min(struct time_filter *tf, uint64_t value, uint32_t now)
{
int i, j;
if (value <= tf->entries[0].value) {
/* Zap them all */
for(i=0; i<NUM_FILTER_ENTRIES; i++) {
@ -400,7 +398,7 @@ apply_filter_min_small(struct time_filter_small *tf,
uint32_t value, uint32_t now)
{
int i, j;
if (value <= tf->entries[0].value) {
/* Zap them all */
for(i=0; i<NUM_FILTER_ENTRIES; i++) {
@ -426,7 +424,7 @@ uint32_t
apply_filter_max(struct time_filter *tf, uint64_t value, uint32_t now)
{
int i, j;
if (value >= tf->entries[0].value) {
/* Zap them all */
for(i=0; i<NUM_FILTER_ENTRIES; i++) {
@ -453,7 +451,7 @@ apply_filter_max_small(struct time_filter_small *tf,
uint32_t value, uint32_t now)
{
int i, j;
if (value >= tf->entries[0].value) {
/* Zap them all */
for(i=0; i<NUM_FILTER_ENTRIES; i++) {

View File

@ -936,7 +936,6 @@ intr_resolve_irq(device_t dev, intptr_t xref, struct intr_map_data *data,
("%s: Found a non-PIC controller: %s", __func__,
device_get_name(pic->pic_dev)));
return (PIC_MAP_INTR(pic->pic_dev, data, isrc));
}
}
@ -1318,7 +1317,6 @@ intr_alloc_msi(device_t pci, device_t child, intptr_t xref, int count,
msi-> isrc = isrc[i];
irqs[i] = intr_map_irq(pic->pic_dev, xref,
(struct intr_map_data *)msi);
}
free(isrc, M_INTRNG);

View File

@ -253,7 +253,7 @@ kobj_class_free(kobj_class_t cls)
ops = cls->ops;
cls->ops = NULL;
}
KOBJ_UNLOCK();
if (ops)

View File

@ -548,7 +548,6 @@ lock_profile_lookup(struct lock_object *lo, int spin, const char *file,
if (lp->line == line && lp->file == p &&
lp->name == lo->lo_name)
return (lp);
}
lp = SLIST_FIRST(&type->lpt_lpalloc);
if (lp == NULL) {

View File

@ -258,7 +258,6 @@ logioctl(struct cdev *dev, u_long com, caddr_t data, int flag, struct thread *td
{
switch (com) {
/* return number of characters immediately available */
case FIONREAD:
*(int *)data = msgbuf_getcount(msgbufp);

View File

@ -473,7 +473,7 @@ md_get_mem(struct mdchain *mdp, caddr_t target, int size, int type)
int error;
u_int count;
u_char *s;
while (size > 0) {
if (m == NULL) {
MBERROR("incomplete copy\n");

View File

@ -54,7 +54,6 @@ preload_search_by_name(const char *name)
int next;
if (preload_metadata != NULL) {
curp = preload_metadata;
for (;;) {
hdr = (uint32_t *)curp;
@ -86,7 +85,6 @@ preload_search_by_type(const char *type)
int next;
if (preload_metadata != NULL) {
curp = preload_metadata;
lname = NULL;
for (;;) {
@ -123,7 +121,6 @@ preload_search_next_name(caddr_t base)
int next;
if (preload_metadata != NULL) {
/* Pick up where we left off last time */
if (base) {
/* skip to next field */
@ -184,7 +181,7 @@ preload_search_info(caddr_t mod, int inf)
if (hdr[0] == type)
break;
}
/*
* Attribute match? Return pointer to data.
* Consumer may safely assume that size value precedes
@ -216,7 +213,6 @@ preload_delete_name(const char *name)
sz = 0;
if (preload_metadata != NULL) {
clearing = 0;
curp = preload_metadata;
for (;;) {
@ -284,7 +280,6 @@ preload_bootstrap_relocate(vm_offset_t offset)
int next;
if (preload_metadata != NULL) {
curp = preload_metadata;
for (;;) {
hdr = (uint32_t *)curp;

View File

@ -218,7 +218,6 @@ msgbuf_addstr(struct msgbuf *mbp, int pri, const char *str, int filter_cr)
* insert a newline before this string.
*/
if (mbp->msg_lastpri != pri && (mbp->msg_flags & MSGBUF_NEEDNL) != 0) {
msgbuf_do_addchar(mbp, &seq, '\n');
mbp->msg_flags &= ~MSGBUF_NEEDNL;
}
@ -239,7 +238,6 @@ msgbuf_addstr(struct msgbuf *mbp, int pri, const char *str, int filter_cr)
if (msgbuf_show_timestamp && needtime == 1 &&
(mbp->msg_flags & MSGBUF_NEEDNL) == 0) {
snprintf(buf, sizeof(buf), "[%jd] ",
(intmax_t)time_uptime);
for (j = 0; buf[j] != '\0'; j++)

View File

@ -121,4 +121,3 @@ power_profile_set_state(int state)
if (changed)
EVENTHANDLER_INVOKE(power_profile_change, 0);
}

View File

@ -97,7 +97,7 @@ sscanf(const char *ibuf, const char *fmt, ...)
{
va_list ap;
int ret;
va_start(ap, fmt);
ret = vsscanf(ibuf, fmt, ap);
va_end(ap);
@ -128,7 +128,7 @@ vsscanf(const char *inp, char const *fmt0, va_list ap)
{ 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
inr = strlen(inp);
nassigned = 0;
nconversions = 0;
nread = 0;
@ -309,7 +309,6 @@ again: c = *fmt++;
* Do the conversion.
*/
switch (c) {
case CT_CHAR:
/* scan arbitrary characters (sets NOSKIP) */
if (width == 0)
@ -434,7 +433,6 @@ again: c = *fmt++;
* if we accept it as a part of number.
*/
switch (c) {
/*
* The digit 0 is always legal, but is
* special. For %i conversions, if no
@ -565,7 +563,6 @@ again: c = *fmt++;
nread += p - buf;
nconversions++;
break;
}
}
input_failure:
@ -613,7 +610,6 @@ __sccl(char *tab, const u_char *fmt)
doswitch:
n = *fmt++; /* and examine the next */
switch (n) {
case 0: /* format ended too soon */
return (fmt - 1);
@ -665,4 +661,3 @@ __sccl(char *tab, const u_char *fmt)
}
/* NOTREACHED */
}

View File

@ -493,7 +493,7 @@ smp_rendezvous_action(void)
#ifdef INVARIANTS
owepreempt = td->td_owepreempt;
#endif
/*
* If requested, run a setup function before the main action
* function. Ensure all CPUs have completed the setup
@ -720,7 +720,7 @@ smp_topo_none(void)
top->cg_children = 0;
top->cg_level = CG_SHARE_NONE;
top->cg_flags = 0;
return (top);
}
@ -1302,4 +1302,3 @@ topo_analyze(struct topo_node *topo_root, int all,
}
#endif /* SMP */

View File

@ -192,7 +192,7 @@ terminal_init(struct terminal *tm)
default_message.ta_bgcolor |= TC_LIGHT;
kernel_message.ta_bgcolor |= TC_LIGHT;
}
if (default_message.ta_bgcolor == TC_BLACK &&
default_message.ta_fgcolor < TC_NCOLORS)
kernel_message.ta_fgcolor |= TC_LIGHT;

View File

@ -342,7 +342,6 @@ turnstile_adjust_thread(struct turnstile *ts, struct thread *td)
td2 = TAILQ_NEXT(td, td_lockq);
if ((td1 != NULL && td->td_priority < td1->td_priority) ||
(td2 != NULL && td->td_priority > td2->td_priority)) {
/*
* Remove thread from blocked chain and determine where
* it should be moved to.
@ -872,7 +871,7 @@ turnstile_signal(struct turnstile *ts, int queue)
return (empty);
}
/*
* Put all blocked threads on the pending list. This must be called with
* the turnstile chain locked.
@ -1160,7 +1159,7 @@ DB_SHOW_COMMAND(turnstile, db_show_turnstile)
print_queue(&ts->ts_blocked[TS_EXCLUSIVE_QUEUE], "Exclusive Waiters",
"\t");
print_queue(&ts->ts_pending, "Pending Threads", "\t");
}
/*
@ -1267,7 +1266,7 @@ DB_SHOW_ALL_COMMAND(chains, db_show_allchains)
DB_SHOW_ALIAS(allchains, db_show_allchains)
static void print_waiters(struct turnstile *ts, int indent);
static void
print_waiter(struct thread *td, int indent)
{

View File

@ -247,7 +247,6 @@ uiomove_faultflag(void *cp, int n, struct uio *uio, int nofault)
cnt = n;
switch (uio->uio_segflg) {
case UIO_USERSPACE:
maybe_yield();
if (uio->uio_rw == UIO_READ)
@ -324,7 +323,6 @@ ureadc(int c, struct uio *uio)
goto again;
}
switch (uio->uio_segflg) {
case UIO_USERSPACE:
if (subyte(iov->iov_base, c) < 0)
return (EFAULT);

View File

@ -1041,7 +1041,6 @@ main(int argc, char **argv)
usage(argv);
exit(2);
}
}
setbuf(stdout, NULL);

View File

@ -959,7 +959,6 @@ witness_ddb_compute_levels(void)
* Look for locks with no parents and level all their descendants.
*/
STAILQ_FOREACH(w, &w_all, w_list) {
/* If the witness has ancestors (is not a root), skip it. */
if (w->w_num_ancestors > 0)
continue;
@ -1032,7 +1031,7 @@ witness_ddb_display_list(int(*prnt)(const char *fmt, ...),
return;
}
}
static void
witness_ddb_display(int(*prnt)(const char *fmt, ...))
{
@ -1053,7 +1052,7 @@ witness_ddb_display(int(*prnt)(const char *fmt, ...))
witness_ddb_display_list(prnt, &w_sleep);
if (db_pager_quit)
return;
/*
* Now do spin locks which have been acquired at least once.
*/
@ -1061,7 +1060,7 @@ witness_ddb_display(int(*prnt)(const char *fmt, ...))
witness_ddb_display_list(prnt, &w_spin);
if (db_pager_quit)
return;
/*
* Finally, any locks which have not been acquired yet.
*/
@ -1101,7 +1100,7 @@ witness_defineorder(struct lock_object *lock1, struct lock_object *lock2)
mtx_unlock_spin(&w_mtx);
return (EDOOFUS);
}
/* Try to add the new order. */
CTR3(KTR_WITNESS, "%s: adding %s as a child of %s", __func__,
lock2->lo_witness->w_name, lock1->lo_witness->w_name);
@ -1130,7 +1129,6 @@ witness_checkorder(struct lock_object *lock, int flags, const char *file,
td = curthread;
if (class->lc_flags & LC_SLEEPLOCK) {
/*
* Since spin locks include a critical section, this check
* implicitly enforces a lock order of all sleep locks before
@ -1150,7 +1148,6 @@ witness_checkorder(struct lock_object *lock, int flags, const char *file,
if (lock_list == NULL || lock_list->ll_count == 0)
return;
} else {
/*
* If this is the first lock, just return as no order
* checking is needed. Avoid problems with thread
@ -1230,7 +1227,7 @@ witness_checkorder(struct lock_object *lock, int flags, const char *file,
plock = &lle->ll_children[lle->ll_count - 1];
}
}
/*
* Try to perform most checks without a lock. If this succeeds we
* can skip acquiring the lock and return success. Otherwise we redo
@ -2013,7 +2010,6 @@ adopt(struct witness *parent, struct witness *child)
/* Find each descendant of 'i' and mark it as a descendant. */
for (j = 1; j <= w_max_used_index; j++) {
/*
* Skip children that are already marked as
* descendants of 'i'.
@ -2498,7 +2494,6 @@ witness_assert(const struct lock_object *lock, int flags, const char *file,
default:
kassert_panic("Invalid lock assertion at %s:%d.",
fixup_filename(file), line);
}
#endif /* INVARIANT_SUPPORT */
}
@ -2979,7 +2974,7 @@ witness_hash_get(const char *key)
{
struct witness *w;
uint32_t hash;
MPASS(key != NULL);
if (witness_cold == 0)
mtx_assert(&w_mtx, MA_OWNED);
@ -3068,7 +3063,7 @@ witness_lock_order_add(struct witness *parent, struct witness *child)
struct witness_lock_order_data *data = NULL;
struct witness_lock_order_key key;
unsigned int hash;
MPASS(parent != NULL && child != NULL);
key.from = parent->w_index;
key.to = child->w_index;

View File

@ -1104,7 +1104,7 @@ kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou,
swizzle_fdset(ibits[0]);
swizzle_fdset(ibits[1]);
swizzle_fdset(ibits[2]);
if (nbufbytes != 0)
bzero(selbits, nbufbytes / 2);

View File

@ -1357,7 +1357,6 @@ pipe_ioctl(struct file *fp, u_long cmd, void *data, struct ucred *active_cred,
error = 0;
switch (cmd) {
case FIONBIO:
break;

View File

@ -310,7 +310,7 @@ soo_stat(struct file *fp, struct stat *ub, struct ucred *active_cred,
ub->st_mode |= S_IRUSR | S_IRGRP | S_IROTH;
ub->st_size = sbavail(sb) - sb->sb_ctl;
SOCKBUF_UNLOCK(sb);
sb = &so->so_snd;
SOCKBUF_LOCK(sb);
if ((sb->sb_state & SBS_CANTSENDMORE) == 0)

View File

@ -546,7 +546,6 @@ kern_msgctl(struct thread *td, int msqid, int cmd, struct msqid_ds *msqbuf)
rval = 0;
switch (cmd) {
case IPC_RMID:
{
#ifdef MAC

View File

@ -2140,4 +2140,3 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, mbufprofileclr,
mbprof_clr_handler, "I",
"clear mbuf profiling statistics");
#endif

View File

@ -907,7 +907,7 @@ mqfs_lookupx(struct vop_cachedlookup_args *ap)
if (pn != NULL)
mqnode_addref(pn);
sx_xunlock(&mqfs->mi_lock);
/* found */
if (pn != NULL) {
/* DELETE */
@ -932,7 +932,7 @@ mqfs_lookupx(struct vop_cachedlookup_args *ap)
cache_enter(dvp, *vpp, cnp);
return (error);
}
/* not found */
/* will create a new entry in the directory ? */
@ -1916,7 +1916,7 @@ static int
_mqueue_recv(struct mqueue *mq, struct mqueue_msg **msg, int timo)
{
int error = 0;
mtx_lock(&mq->mq_mutex);
while ((*msg = TAILQ_FIRST(&mq->mq_msgq)) == NULL && error == 0) {
if (timo < 0) {
@ -2447,7 +2447,7 @@ mqueue_fdclose(struct thread *td, int fd, struct file *fp)
struct mqueue *mq;
#ifdef INVARIANTS
struct filedesc *fdp;
fdp = td->td_proc->p_fd;
FILEDESC_LOCK_ASSERT(fdp);
#endif

View File

@ -176,7 +176,7 @@ ksem_stat(struct file *fp, struct stat *sb, struct ucred *active_cred,
if (error)
return (error);
#endif
/*
* Attempt to return sanish values for fstat() on a semaphore
* file descriptor.

View File

@ -415,7 +415,7 @@ shm_stat(struct file *fp, struct stat *sb, struct ucred *active_cred,
if (error)
return (error);
#endif
/*
* Attempt to return sanish values for fstat() on a memory file
* descriptor.
@ -1203,7 +1203,7 @@ shm_mmap(struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t objsize,
if (error != 0)
goto out;
#endif
mtx_lock(&shm_timestamp_lock);
vfs_timestamp(&shmfd->shm_atime);
mtx_unlock(&shm_timestamp_lock);

View File

@ -599,7 +599,7 @@ sysctl_handle_sb_max(SYSCTL_HANDLER_ARGS)
sb_max_adj = (u_quad_t)sb_max * MCLBYTES / (MSIZE + MCLBYTES);
return (0);
}
/*
* Allot mbufs to a sockbuf. Attempt to scale mbmax so that mbcnt doesn't
* become limiting if buffering efficiency is near the normal case.

View File

@ -290,7 +290,7 @@ socket_zone_change(void *tag)
static void
socket_hhook_register(int subtype)
{
if (hhook_head_register(HHOOK_TYPE_SOCKET, subtype,
&V_socket_hhh[subtype],
HHOOK_NOWAIT|HHOOK_HEADISINVNET) != 0)
@ -300,7 +300,7 @@ socket_hhook_register(int subtype)
static void
socket_hhook_deregister(int subtype)
{
if (hhook_head_deregister(V_socket_hhh[subtype]) != 0)
printf("%s: WARNING: unable to deregister hook\n", __func__);
}

View File

@ -2275,7 +2275,6 @@ unp_internalize(struct mbuf **controlp, struct thread *td)
error = EOPNOTSUPP;
goto out;
}
}
/*
@ -2648,7 +2647,6 @@ unp_gc(__unused void *arg, int pending)
for (head = heads; *head != NULL; head++)
LIST_FOREACH(unp, *head, unp_link) {
KASSERT((unp->unp_gcflag & ~UNPGC_IGNORE_RIGHTS) == 0,
("%s: unp %p has unexpected gc flags 0x%x",
__func__, unp, (unsigned int)unp->unp_gcflag));

View File

@ -3163,7 +3163,6 @@ vfs_bio_awrite(struct buf *bp)
if ((vp->v_type == VREG) &&
(vp->v_mount != 0) && /* Only on nodes that have the size info */
(bp->b_flags & (B_CLUSTEROK | B_INVAL)) == B_CLUSTEROK) {
size = vp->v_mount->mnt_stat.f_iosize;
maxcl = MAXPHYS / size;

View File

@ -541,4 +541,3 @@ vfs_stdcheckexp(struct mount *mp, struct sockaddr *nam, uint64_t *extflagsp,
lockmgr(&mp->mnt_explock, LK_RELEASE, NULL);
return (0);
}

View File

@ -2625,7 +2625,6 @@ sched_sync(void)
wdog_kern_pat(WD_LASTVAL);
mtx_lock(&sync_mtx);
}
}
if (syncer_state == SYNCER_FINAL_DELAY && syncer_final_iter > 0)
syncer_final_iter--;