[PATCH 32/32] xtensa: copy_thread(): rename 'arg' argument to 'kthread_arg'

From: Alex Dowad
Date: Fri Mar 13 2015 - 14:17:46 EST


Rename the 'thread_fn_arg' it to 'kthread_arg' for consistency
with do_fork() and other arch-specific implementations of copy_thread().

Signed-off-by: Alex Dowad <alexinbeijing@xxxxxxxxx>
---
arch/xtensa/kernel/process.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c
index 1c85323..b12f5dc 100644
--- a/arch/xtensa/kernel/process.c
+++ b/arch/xtensa/kernel/process.c
@@ -147,7 +147,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
}

/*
- * Copy thread.
+ * Copy architecture-specific thread state
*
* There are two modes in which this function is called:
* 1) Userspace thread creation,
@@ -156,7 +156,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
* in the clone_flags) and set up passed usp in the childregs.
* 2) Kernel thread creation,
* regs == NULL, usp_thread_fn is the function to run in the new thread
- * and thread_fn_arg is its parameter.
+ * and kthread_arg is its parameter.
* childregs are not used for the kernel threads.
*
* The stack layout for the new thread looks like this:
@@ -187,9 +187,8 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
* One solution is to spill windows to the parent stack, but that's fairly
* involved. Much simpler to just not copy those live frames across.
*/
-
int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn,
- unsigned long thread_fn_arg, struct task_struct *p)
+ unsigned long kthread_arg, struct task_struct *p)
{
struct pt_regs *childregs = task_pt_regs(p);

@@ -204,6 +203,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn,
p->thread.sp = (unsigned long)childregs;

if (!(p->flags & PF_KTHREAD)) {
+ /* user thread */
struct pt_regs *regs = current_pt_regs();
unsigned long usp = usp_thread_fn ?
usp_thread_fn : regs->areg[1];
@@ -254,13 +254,14 @@ int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn,
if (clone_flags & CLONE_SETTLS)
childregs->threadptr = childregs->areg[5];
} else {
+ /* kernel thread */
p->thread.ra = MAKE_RA_FOR_CALL(
(unsigned long)ret_from_kernel_thread, 1);

/* pass parameters to ret_from_kernel_thread:
* a2 = thread_fn, a3 = thread_fn arg
*/
- *((int *)childregs - 1) = thread_fn_arg;
+ *((int *)childregs - 1) = kthread_arg;
*((int *)childregs - 2) = usp_thread_fn;

/* Childregs are only used when we're going to userspace
--
2.0.0.GIT

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