aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorKarol Swietlicki <magotari@gmail.com>2008-02-05 01:30:49 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-05 12:44:26 -0500
commit291248fd6e371bcbfb8a77689c5d741a1527488f (patch)
tree249acacdd2ca8d8194415f22930b4b5bccc59d32 /arch/um
parentab8cda4347e2ffed658e522c9398932509c278bd (diff)
uml: remove unused variables in the context switcher
This patch removes a variable which was not used in two functions. Yet another code cleanup, nothing really significant. Please note that I could not test this on x86_64. I don't have the hardware for it. [ jdike - Bits of tidying around the affected code. Also, it's fine on x86_64 ] Signed-off-by: Karol Swietlicki <magotari@gmail.com> Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/kernel/process.c19
-rw-r--r--arch/um/sys-i386/ptrace.c6
-rw-r--r--arch/um/sys-i386/tls.c2
-rw-r--r--arch/um/sys-x86_64/syscalls.c2
4 files changed, 13 insertions, 16 deletions
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index 91bd68eaba20..62a4e0e12c9c 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -81,12 +81,12 @@ static inline void set_current(struct task_struct *task)
81 { external_pid(task), task }); 81 { external_pid(task), task });
82} 82}
83 83
84extern void arch_switch_to(struct task_struct *from, struct task_struct *to); 84extern void arch_switch_to(struct task_struct *to);
85 85
86void *_switch_to(void *prev, void *next, void *last) 86void *_switch_to(void *prev, void *next, void *last)
87{ 87{
88 struct task_struct *from = prev; 88 struct task_struct *from = prev;
89 struct task_struct *to= next; 89 struct task_struct *to = next;
90 90
91 to->thread.prev_sched = from; 91 to->thread.prev_sched = from;
92 set_current(to); 92 set_current(to);
@@ -94,16 +94,15 @@ void *_switch_to(void *prev, void *next, void *last)
94 do { 94 do {
95 current->thread.saved_task = NULL; 95 current->thread.saved_task = NULL;
96 96
97 switch_threads(&from->thread.switch_buf, 97 switch_threads(&from->thread.switch_buf, &to->thread.switch_buf);
98 &to->thread.switch_buf);
99 98
100 arch_switch_to(current->thread.prev_sched, current); 99 arch_switch_to(current);
101 100
102 if (current->thread.saved_task) 101 if (current->thread.saved_task)
103 show_regs(&(current->thread.regs)); 102 show_regs(&(current->thread.regs));
104 next= current->thread.saved_task; 103 next = current->thread.saved_task;
105 prev= current; 104 prev = current;
106 } while(current->thread.saved_task); 105 } while (current->thread.saved_task);
107 106
108 return current->thread.prev_sched; 107 return current->thread.prev_sched;
109 108
@@ -161,8 +160,6 @@ void new_thread_handler(void)
161void fork_handler(void) 160void fork_handler(void)
162{ 161{
163 force_flush_all(); 162 force_flush_all();
164 if (current->thread.prev_sched == NULL)
165 panic("blech");
166 163
167 schedule_tail(current->thread.prev_sched); 164 schedule_tail(current->thread.prev_sched);
168 165
@@ -171,7 +168,7 @@ void fork_handler(void)
171 * arch_switch_to isn't needed. We could want to apply this to 168 * arch_switch_to isn't needed. We could want to apply this to
172 * improve performance. -bb 169 * improve performance. -bb
173 */ 170 */
174 arch_switch_to(current->thread.prev_sched, current); 171 arch_switch_to(current);
175 172
176 current->thread.prev_sched = NULL; 173 current->thread.prev_sched = NULL;
177 174
diff --git a/arch/um/sys-i386/ptrace.c b/arch/um/sys-i386/ptrace.c
index bd3da8a61f64..6b4499906a6c 100644
--- a/arch/um/sys-i386/ptrace.c
+++ b/arch/um/sys-i386/ptrace.c
@@ -8,11 +8,11 @@
8#include "asm/uaccess.h" 8#include "asm/uaccess.h"
9#include "skas.h" 9#include "skas.h"
10 10
11extern int arch_switch_tls(struct task_struct *from, struct task_struct *to); 11extern int arch_switch_tls(struct task_struct *to);
12 12
13void arch_switch_to(struct task_struct *from, struct task_struct *to) 13void arch_switch_to(struct task_struct *to)
14{ 14{
15 int err = arch_switch_tls(from, to); 15 int err = arch_switch_tls(to);
16 if (!err) 16 if (!err)
17 return; 17 return;
18 18
diff --git a/arch/um/sys-i386/tls.c b/arch/um/sys-i386/tls.c
index 027e86ad9e5c..f29b8a8fc1e0 100644
--- a/arch/um/sys-i386/tls.c
+++ b/arch/um/sys-i386/tls.c
@@ -172,7 +172,7 @@ void clear_flushed_tls(struct task_struct *task)
172 * SKAS patch. 172 * SKAS patch.
173 */ 173 */
174 174
175int arch_switch_tls(struct task_struct *from, struct task_struct *to) 175int arch_switch_tls(struct task_struct *to)
176{ 176{
177 if (!host_supports_tls) 177 if (!host_supports_tls)
178 return 0; 178 return 0;
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c
index 86f6b18410ee..e437ee2215c5 100644
--- a/arch/um/sys-x86_64/syscalls.c
+++ b/arch/um/sys-x86_64/syscalls.c
@@ -105,7 +105,7 @@ long sys_clone(unsigned long clone_flags, unsigned long newsp,
105 return ret; 105 return ret;
106} 106}
107 107
108void arch_switch_to(struct task_struct *from, struct task_struct *to) 108void arch_switch_to(struct task_struct *to)
109{ 109{
110 if ((to->thread.arch.fs == 0) || (to->mm == NULL)) 110 if ((to->thread.arch.fs == 0) || (to->mm == NULL))
111 return; 111 return;