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/x86/kernel/process_32.c | 9 +++++++--
 arch/x86/kernel/process_64.c | 9 +++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 603c4f9..efb4a6b 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -129,8 +129,11 @@ void release_thread(struct task_struct *dead_task)
        release_vm86_irqs(dead_task);
 }
 
+/*
+ * 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)
 {
        struct pt_regs *childregs = task_pt_regs(p);
        struct task_struct *tsk;
@@ -149,13 +152,15 @@ int copy_thread(unsigned long clone_flags, unsigned long 
sp,
                childregs->es = __USER_DS;
                childregs->fs = __KERNEL_PERCPU;
                childregs->bx = sp;     /* function */
-               childregs->bp = arg;
+               childregs->bp = kthread_arg;
                childregs->orig_ax = -1;
                childregs->cs = __KERNEL_CS | get_kernel_rpl();
                childregs->flags = X86_EFLAGS_IF | X86_EFLAGS_FIXED;
                p->thread.io_bitmap_ptr = NULL;
                return 0;
        }
+
+       /* user thread */
        *childregs = *current_pt_regs();
        childregs->ax = 0;
        if (sp)
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 67fcc43..a27abb6 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -151,8 +151,11 @@ static inline u32 read_32bit_tls(struct task_struct *t, 
int tls)
        return get_desc_base(&t->thread.tls_array[tls]);
 }
 
+/*
+ * 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)
 {
        int err;
        struct pt_regs *childregs;
@@ -179,12 +182,14 @@ int copy_thread(unsigned long clone_flags, unsigned long 
sp,
                childregs->sp = (unsigned long)childregs;
                childregs->ss = __KERNEL_DS;
                childregs->bx = sp; /* function */
-               childregs->bp = arg;
+               childregs->bp = kthread_arg;
                childregs->orig_ax = -1;
                childregs->cs = __KERNEL_CS | get_kernel_rpl();
                childregs->flags = X86_EFLAGS_IF | X86_EFLAGS_FIXED;
                return 0;
        }
+
+       /* user thread */
        *childregs = *current_pt_regs();
 
        childregs->ax = 0;
-- 
2.0.0.GIT

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to