The 'arg' argument to copy_thread() is only ever used when forking a new
kernel thread. Hence, rename it to 'kthread_arg' for clarity (and consistency
with do_fork() and other arch-specific implementations of copy_thread()).

Signed-off-by: Alex Dowad <alexinbeij...@gmail.com>
---
 arch/um/kernel/process.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index f17bca8..80ac9fe 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -149,8 +149,11 @@ void fork_handler(void)
        userspace(&current->thread.regs.regs);
 }
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long sp,
-               unsigned long arg, struct task_struct * p)
+               unsigned long kthread_arg, struct task_struct *p)
 {
        void (*handler)(void);
        int kthread = current->flags & PF_KTHREAD;
@@ -159,6 +162,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
        p->thread = (struct thread_struct) INIT_THREAD;
 
        if (!kthread) {
+               /* user thread */
                memcpy(&p->thread.regs.regs, current_pt_regs(),
                       sizeof(p->thread.regs.regs));
                PT_REGS_SET_SYSCALL_RETURN(&p->thread.regs, 0);
@@ -169,9 +173,10 @@ int copy_thread(unsigned long clone_flags, unsigned long 
sp,
 
                arch_copy_thread(&current->thread.arch, &p->thread.arch);
        } else {
+               /* kernel thread */
                get_safe_registers(p->thread.regs.regs.gp, 
p->thread.regs.regs.fp);
                p->thread.request.u.thread.proc = (int (*)(void *))sp;
-               p->thread.request.u.thread.arg = (void *)arg;
+               p->thread.request.u.thread.arg = (void *)kthread_arg;
                handler = new_thread_handler;
        }
 
-- 
2.0.0.GIT


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Reply via email to