Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 May 2002 22:22:43 -0700 (PDT)
From:      Jonathan Mini <mini@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 11783 for review
Message-ID:  <200205230522.g4N5MhD20753@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=11783

Change 11783 by mini@mini_stylus on 2002/05/22 22:22:28

	Don't initialize local variables in their declaration.

Affected files ...

... //depot/projects/kse/sys/kern/kern_sig.c#51 edit
... //depot/projects/kse/sys/kern/kern_switch.c#45 edit
... //depot/projects/kse/sys/kern/kern_thread.c#49 edit

Differences ...

==== //depot/projects/kse/sys/kern/kern_sig.c#51 (text+ko) ====

@@ -1588,10 +1588,11 @@
 issignal(td)
 	struct thread *td;
 {
-	struct proc *p = td->td_proc;
+	struct proc *p;
 	sigset_t mask;
 	register int sig, prop;
 
+	p = td->td_proc;
 	PROC_LOCK_ASSERT(p, MA_OWNED);
 	for (;;) {
 		int traced = (p->p_flag & P_TRACED) || (p->p_stops & S_SIG);

==== //depot/projects/kse/sys/kern/kern_switch.c#45 (text+ko) ====

@@ -228,12 +228,13 @@
 setrunqueue(struct thread *td)
 {
 	struct kse *ke;
-	struct ksegrp *kg = td->td_ksegrp;
+	struct ksegrp *kg;
 	struct thread *td2;
 
 	CTR1(KTR_RUNQ, "setrunqueue: td%p", td);
 	KASSERT((td->td_state != TDS_RUNQ), ("setrunqueue: bad thread state"));
 	td->td_state = TDS_RUNQ;
+	kg = td->td_ksegrp;
 	kg->kg_runnable++;
 	if ((td->td_flags & TDF_UNBOUND) == 0) {
 		/*

==== //depot/projects/kse/sys/kern/kern_thread.c#49 (text+ko) ====

@@ -250,7 +250,7 @@
 int
 thread_export_context(struct thread *td)
 {
-	struct kse *ke = td->td_kse;
+	struct kse *ke;
 	void *td2_mbx;
 	void *addr1;
 	void *addr2;
@@ -259,6 +259,7 @@
 	/* Export the register contents. */
 	error = cpu_export_context(td);
 
+	ke = td->td_kse;
 	addr1 = (caddr_t)ke->ke_mailbox
 			+ offsetof(struct kse_mailbox, completed_threads);
 	addr2 = (caddr_t)td->td_mailbox
@@ -317,8 +318,9 @@
 void
 thread_link(struct thread *td, struct ksegrp *kg)
 {
-	struct proc *p = kg->kg_proc;
+	struct proc *p;
 
+	p = kg->kg_proc;
 	td->td_state = TDS_NEW;
 	td->td_proc	= p;
 	td->td_ksegrp	= kg;
@@ -380,10 +382,12 @@
 int
 thread_single(int how)
 {
-	struct thread *td = curthread;
+	struct thread *td;
 	struct thread *td2;
-	struct proc *p = td->td_proc;
+	struct proc *p;
 
+	td = curthread;
+	p = td->td_proc;
 	PROC_LOCK_ASSERT(p, MA_OWNED);
 	KASSERT((td != NULL), ("curthread is NULL"));
 
@@ -469,6 +473,8 @@
 	struct thread *td = curthread;
 	struct proc *p = td->td_proc;
 
+	td = curthread;
+	p = td->td_proc;
 	PROC_LOCK_ASSERT(p, MA_OWNED);
 	while (P_SHOULDSTOP(p)) {
 		if (how && (td != p->p_singlethread)) {

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205230522.g4N5MhD20753>