summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2004-09-22 15:24:33 +0000
committerjhb <jhb@FreeBSD.org>2004-09-22 15:24:33 +0000
commit39563036071c35de79aa935b7bdfc209277f3afb (patch)
tree868f409e596498f500847bbc4ec4cc18c58356b2
parentdd60f24093444fdbc0af6b156c91edf47be72655 (diff)
downloadFreeBSD-src-39563036071c35de79aa935b7bdfc209277f3afb.zip
FreeBSD-src-39563036071c35de79aa935b7bdfc209277f3afb.tar.gz
Various small style fixes.
-rw-r--r--sys/compat/svr4/svr4_misc.c2
-rw-r--r--sys/kern/kern_exit.c8
-rw-r--r--sys/kern/kern_kse.c14
-rw-r--r--sys/kern/kern_resource.c6
-rw-r--r--sys/kern/kern_thread.c2
-rw-r--r--sys/kern/subr_trap.c3
6 files changed, 20 insertions, 15 deletions
diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c
index 243dc22..6475bad 100644
--- a/sys/compat/svr4/svr4_misc.c
+++ b/sys/compat/svr4/svr4_misc.c
@@ -1298,7 +1298,7 @@ loop:
q->p_xstat = 0;
ruadd(&td->td_proc->p_stats->p_cru, q->p_ru);
FREE(q->p_ru, M_ZOMBIE);
- q->p_ru = 0;
+ q->p_ru = NULL;
/*
* Decrement the count of procs running with this uid.
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 747fb3b..74670e5 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -103,7 +103,7 @@ sys_exit(struct thread *td, struct sys_exit_args *uap)
void
exit1(struct thread *td, int rv)
{
- struct bintime new_switchtime;
+ struct bintime new_switchtime;
struct proc *p, *nq, *q;
struct tty *tp;
struct vnode *ttyvp;
@@ -428,6 +428,7 @@ retry:
* Notify interested parties of our demise.
*/
KNOTE_LOCKED(&p->p_klist, NOTE_EXIT);
+
/*
* Just delete all entries in the p_klist. At this point we won't
* report any more events, and there are nasty race conditions that
@@ -517,7 +518,7 @@ retry:
sched_exit(p->p_pptr, td);
/*
- * hopefully no one will try to deliver a signal to the process this
+ * Hopefully no one will try to deliver a signal to the process this
* late in the game.
*/
knlist_destroy(&p->p_klist);
@@ -564,7 +565,8 @@ wait4(struct thread *td, struct wait_args *uap)
}
int
-kern_wait(struct thread *td, pid_t pid, int *status, int options, struct rusage *rusage)
+kern_wait(struct thread *td, pid_t pid, int *status, int options,
+ struct rusage *rusage)
{
int nfound;
struct proc *p, *q, *t;
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c
index 4a89665..3ecebe9 100644
--- a/sys/kern/kern_kse.c
+++ b/sys/kern/kern_kse.c
@@ -111,10 +111,10 @@ void
upcall_remove(struct thread *td)
{
- if (td->td_upcall) {
+ if (td->td_upcall != NULL) {
td->td_upcall->ku_owner = NULL;
upcall_unlink(td->td_upcall);
- td->td_upcall = 0;
+ td->td_upcall = NULL;
}
}
@@ -661,7 +661,7 @@ kse_create(struct thread *td, struct kse_create_args *uap)
/*
* If we are the first time, and a normal thread,
- * then trnasfer all the signals back to the 'process'.
+ * then transfer all the signals back to the 'process'.
* SA threading will make a special thread to handle them.
*/
if (first && sa) {
@@ -672,14 +672,14 @@ kse_create(struct thread *td, struct kse_create_args *uap)
}
/*
- * Make the new upcall available to the ksegrp,.
- * It may or may not use it, but its available.
+ * Make the new upcall available to the ksegrp.
+ * It may or may not use it, but it's available.
*/
mtx_lock_spin(&sched_lock);
PROC_UNLOCK(p);
upcall_link(newku, newkg);
if (mbx.km_quantum)
- newkg->kg_upquantum = max(1, mbx.km_quantum/tick);
+ newkg->kg_upquantum = max(1, mbx.km_quantum / tick);
/*
* Each upcall structure has an owner thread, find which
@@ -1312,7 +1312,7 @@ thread_userret(struct thread *td, struct trapframe *frame)
if (td->td_pflags & TDP_UPCALLING) {
uts_crit = 0;
- kg->kg_nextupcall = ticks+kg->kg_upquantum;
+ kg->kg_nextupcall = ticks + kg->kg_upquantum;
/*
* There is no more work to do and we are going to ride
* this thread up to userland as an upcall.
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index 0e90a62..b0c5a44 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -848,7 +848,8 @@ getrusage(td, uap)
void
ruadd(ru, ru2)
- register struct rusage *ru, *ru2;
+ struct rusage *ru;
+ struct rusage *ru2;
{
register long *ip, *ip2;
register int i;
@@ -857,7 +858,8 @@ ruadd(ru, ru2)
timevaladd(&ru->ru_stime, &ru2->ru_stime);
if (ru->ru_maxrss < ru2->ru_maxrss)
ru->ru_maxrss = ru2->ru_maxrss;
- ip = &ru->ru_first; ip2 = &ru2->ru_first;
+ ip = &ru->ru_first;
+ ip2 = &ru2->ru_first;
for (i = &ru->ru_last - &ru->ru_first; i >= 0; i--)
*ip++ += *ip2++;
}
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index f8f2546..a6e4bdc 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -140,7 +140,7 @@ thread_ctor(void *mem, int size, void *arg, int flags)
td = (struct thread *)mem;
td->td_state = TDS_INACTIVE;
- td->td_oncpu = NOCPU;
+ td->td_oncpu = NOCPU;
/*
* Note that td_critnest begins life as 1 because the thread is not
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index 3f68103..55b23c9 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -164,6 +164,7 @@ ast(struct trapframe *framep)
if ((p->p_flag & P_SA) && (td->td_mailbox == NULL))
thread_user_enter(td);
+
/*
* This updates the p_sflag's for the checks below in one
* "atomic" operation with turning off the astpending flag.
@@ -183,6 +184,7 @@ ast(struct trapframe *framep)
TDF_NEEDRESCHED | TDF_INTERRUPT);
cnt.v_soft++;
mtx_unlock_spin(&sched_lock);
+
/*
* XXXKSE While the fact that we owe a user profiling
* tick is stored per KSE in this code, the statistics
@@ -190,7 +192,6 @@ ast(struct trapframe *framep)
* This should probably change, by which I mean that
* possibly the location of both might change.
*/
-
if (td->td_ucred != p->p_ucred)
cred_update_thread(td);
if (td->td_pflags & TDP_OWEUPC && p->p_flag & P_PROFIL) {
OpenPOWER on IntegriCloud