All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-13 18:14 Alex Dowad
  2015-03-13 18:14   ` Alex Dowad
                   ` (21 more replies)
  0 siblings, 22 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: David Howells

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 <alexinbeijing@gmail.com>
---
 arch/frv/kernel/process.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c
index 5d40aeb77..bca9f55 100644
--- a/arch/frv/kernel/process.c
+++ b/arch/frv/kernel/process.c
@@ -123,10 +123,10 @@ inline unsigned long user_stack(const struct pt_regs *regs)
 }
 
 /*
- * set up the kernel stack and exception frames for a new process
+ * Copy architecture-specific thread state
  */
 int copy_thread(unsigned long clone_flags,
-		unsigned long usp, unsigned long arg,
+		unsigned long usp, unsigned long kthread_arg,
 		struct task_struct *p)
 {
 	struct pt_regs *childregs;
@@ -145,8 +145,9 @@ int copy_thread(unsigned long clone_flags,
 	p->thread.frame0 = childregs;
 
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		childregs->gr9 = usp; /* function */
-		childregs->gr8 = arg;
+		childregs->gr8 = kthread_arg;
 		p->thread.pc = (unsigned long) ret_from_kernel_thread;
 		save_user_regs(p->thread.user);
 		return 0;
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 12/32] hexagon: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
@ 2015-03-13 18:14   ` Alex Dowad
  2015-03-13 18:14   ` Alex Dowad
                     ` (20 subsequent siblings)
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Richard Kuo, open list:QUALCOMM HEXAGON...

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 <alexinbeijing@gmail.com>
---
 arch/hexagon/kernel/process.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/hexagon/kernel/process.c b/arch/hexagon/kernel/process.c
index 0a0dd5c..6f27358 100644
--- a/arch/hexagon/kernel/process.c
+++ b/arch/hexagon/kernel/process.c
@@ -71,7 +71,7 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
  * Copy architecture-specific thread state
  */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-		unsigned long arg, struct task_struct *p)
+		unsigned long kthread_arg, struct task_struct *p)
 {
 	struct thread_info *ti = task_thread_info(p);
 	struct hexagon_switch_stack *ss;
@@ -94,10 +94,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 	ss->lr = (unsigned long)ret_from_fork;
 	p->thread.switch_sp = ss;
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		memset(childregs, 0, sizeof(struct pt_regs));
 		/* r24 <- fn, r25 <- arg */
 		ss->r24 = usp;
-		ss->r25 = arg;
+		ss->r25 = kthread_arg;
 		pt_set_kmode(childregs);
 		return 0;
 	}
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 12/32] hexagon: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-13 18:14   ` Alex Dowad
  0 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Richard Kuo, open list:QUALCOMM HEXAGON...

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 <alexinbeijing@gmail.com>
---
 arch/hexagon/kernel/process.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/hexagon/kernel/process.c b/arch/hexagon/kernel/process.c
index 0a0dd5c..6f27358 100644
--- a/arch/hexagon/kernel/process.c
+++ b/arch/hexagon/kernel/process.c
@@ -71,7 +71,7 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
  * Copy architecture-specific thread state
  */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-		unsigned long arg, struct task_struct *p)
+		unsigned long kthread_arg, struct task_struct *p)
 {
 	struct thread_info *ti = task_thread_info(p);
 	struct hexagon_switch_stack *ss;
@@ -94,10 +94,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 	ss->lr = (unsigned long)ret_from_fork;
 	p->thread.switch_sp = ss;
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		memset(childregs, 0, sizeof(struct pt_regs));
 		/* r24 <- fn, r25 <- arg */
 		ss->r24 = usp;
-		ss->r25 = arg;
+		ss->r25 = kthread_arg;
 		pt_set_kmode(childregs);
 		return 0;
 	}
-- 
2.0.0.GIT

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 13/32] ia64: copy_thread(): rename 'user_stack_size' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
@ 2015-03-13 18:14   ` Alex Dowad
  2015-03-13 18:14   ` Alex Dowad
                     ` (20 subsequent siblings)
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel
  Cc: Tony Luck, Fenghua Yu, Tejun Heo, Christoph Lameter,
	Matt Fleming, open list:IA64 (Itanium) PL...

'user_stack_size' is very misleading, since the argument is never used for the
size of the user stack. Rather, it is an argument which is passed to the main
function executed by a newly forked kernel thread. Hence, rename it to
'kthread_arg'.

When forking a new user thread, the kernel thread arg was (uselessly) added
to the new user stack pointer. This "worked", since the kernel thread arg is
always zero when forking a user thread, but it was obviously not intended.

Signed-off-by: Alex Dowad <alexinbeijing@gmail.com>
---
 arch/ia64/kernel/process.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index b515149..d4a78da 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -300,7 +300,7 @@ ia64_load_extra (struct task_struct *task)
 }
 
 /*
- * Copy the state of an ia-64 thread.
+ * Copy the architecture-specific state of an ia-64 thread.
  *
  * We get here through the following  call chain:
  *
@@ -332,7 +332,7 @@ ia64_load_extra (struct task_struct *task)
  */
 int
 copy_thread(unsigned long clone_flags,
-	     unsigned long user_stack_base, unsigned long user_stack_size,
+	     unsigned long user_stack_base, unsigned long kthread_arg,
 	     struct task_struct *p)
 {
 	extern char ia64_ret_from_clone;
@@ -376,13 +376,14 @@ copy_thread(unsigned long clone_flags,
 	ia64_drop_fpu(p);	/* don't pick up stale state from a CPU's fph */
 
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		if (unlikely(!user_stack_base)) {
 			/* fork_idle() called us */
 			return 0;
 		}
 		memset(child_stack, 0, sizeof(*child_ptregs) + sizeof(*child_stack));
 		child_stack->r4 = user_stack_base;	/* payload */
-		child_stack->r5 = user_stack_size;	/* argument */
+		child_stack->r5 = kthread_arg;
 		/*
 		 * Preserve PSR bits, except for bits 32-34 and 37-45,
 		 * which we can't read.
@@ -406,6 +407,8 @@ copy_thread(unsigned long clone_flags,
 
 		return 0;
 	}
+
+	/* user thread */
 	stack = ((struct switch_stack *) regs) - 1;
 	/* copy parent's switch_stack & pt_regs to child: */
 	memcpy(child_stack, stack, sizeof(*child_ptregs) + sizeof(*child_stack));
@@ -416,7 +419,7 @@ copy_thread(unsigned long clone_flags,
 	if (clone_flags & CLONE_SETTLS)
 		child_ptregs->r13 = regs->r16;	/* see sys_clone2() in entry.S */
 	if (user_stack_base) {
-		child_ptregs->r12 = user_stack_base + user_stack_size - 16;
+		child_ptregs->r12 = user_stack_base - 16;
 		child_ptregs->ar_bspstore = user_stack_base;
 		child_ptregs->ar_rnat = 0;
 		child_ptregs->loadrs = 0;
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 13/32] ia64: copy_thread(): rename 'user_stack_size' argument to 'kthread_arg'
@ 2015-03-13 18:14   ` Alex Dowad
  0 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel
  Cc: Tony Luck, Fenghua Yu, Tejun Heo, Christoph Lameter,
	Matt Fleming, open list:IA64 Itanium PL...

'user_stack_size' is very misleading, since the argument is never used for the
size of the user stack. Rather, it is an argument which is passed to the main
function executed by a newly forked kernel thread. Hence, rename it to
'kthread_arg'.

When forking a new user thread, the kernel thread arg was (uselessly) added
to the new user stack pointer. This "worked", since the kernel thread arg is
always zero when forking a user thread, but it was obviously not intended.

Signed-off-by: Alex Dowad <alexinbeijing@gmail.com>
---
 arch/ia64/kernel/process.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index b515149..d4a78da 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -300,7 +300,7 @@ ia64_load_extra (struct task_struct *task)
 }
 
 /*
- * Copy the state of an ia-64 thread.
+ * Copy the architecture-specific state of an ia-64 thread.
  *
  * We get here through the following  call chain:
  *
@@ -332,7 +332,7 @@ ia64_load_extra (struct task_struct *task)
  */
 int
 copy_thread(unsigned long clone_flags,
-	     unsigned long user_stack_base, unsigned long user_stack_size,
+	     unsigned long user_stack_base, unsigned long kthread_arg,
 	     struct task_struct *p)
 {
 	extern char ia64_ret_from_clone;
@@ -376,13 +376,14 @@ copy_thread(unsigned long clone_flags,
 	ia64_drop_fpu(p);	/* don't pick up stale state from a CPU's fph */
 
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		if (unlikely(!user_stack_base)) {
 			/* fork_idle() called us */
 			return 0;
 		}
 		memset(child_stack, 0, sizeof(*child_ptregs) + sizeof(*child_stack));
 		child_stack->r4 = user_stack_base;	/* payload */
-		child_stack->r5 = user_stack_size;	/* argument */
+		child_stack->r5 = kthread_arg;
 		/*
 		 * Preserve PSR bits, except for bits 32-34 and 37-45,
 		 * which we can't read.
@@ -406,6 +407,8 @@ copy_thread(unsigned long clone_flags,
 
 		return 0;
 	}
+
+	/* user thread */
 	stack = ((struct switch_stack *) regs) - 1;
 	/* copy parent's switch_stack & pt_regs to child: */
 	memcpy(child_stack, stack, sizeof(*child_ptregs) + sizeof(*child_stack));
@@ -416,7 +419,7 @@ copy_thread(unsigned long clone_flags,
 	if (clone_flags & CLONE_SETTLS)
 		child_ptregs->r13 = regs->r16;	/* see sys_clone2() in entry.S */
 	if (user_stack_base) {
-		child_ptregs->r12 = user_stack_base + user_stack_size - 16;
+		child_ptregs->r12 = user_stack_base - 16;
 		child_ptregs->ar_bspstore = user_stack_base;
 		child_ptregs->ar_rnat = 0;
 		child_ptregs->loadrs = 0;
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 14/32] m32r: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
  2015-03-13 18:14   ` Alex Dowad
  2015-03-13 18:14   ` Alex Dowad
@ 2015-03-13 18:14 ` Alex Dowad
  2015-03-13 18:14 ` [PATCH 15/32] m68k: " Alex Dowad
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel

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 <alexinbeijing@gmail.com>
---
 arch/m32r/kernel/process.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c
index e69221d..6d5edf2 100644
--- a/arch/m32r/kernel/process.c
+++ b/arch/m32r/kernel/process.c
@@ -128,21 +128,25 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
 	return 0; /* Task didn't use the fpu at all. */
 }
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long spu,
-	unsigned long arg, struct task_struct *tsk)
+	unsigned long kthread_arg, struct task_struct *tsk)
 {
 	struct pt_regs *childregs = task_pt_regs(tsk);
 	extern void ret_from_fork(void);
 	extern void ret_from_kernel_thread(void);
 
 	if (unlikely(tsk->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		memset(childregs, 0, sizeof(struct pt_regs));
 		childregs->psw = M32R_PSW_BIE;
 		childregs->r1 = spu;	/* fn */
-		childregs->r0 = arg;
+		childregs->r0 = kthread_arg;
 		tsk->thread.lr = (unsigned long)ret_from_kernel_thread;
 	} else {
-		/* Copy registers */
+		/* user thread: copy registers */
 		*childregs = *current_pt_regs();
 		if (spu)
 			childregs->spu = spu;
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 15/32] m68k: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
                   ` (2 preceding siblings ...)
  2015-03-13 18:14 ` [PATCH 14/32] m32r: copy_thread(): rename 'arg' " Alex Dowad
@ 2015-03-13 18:14 ` Alex Dowad
  2015-03-13 18:14 ` Alex Dowad
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Geert Uytterhoeven, open list:M68K ARCHITECTURE

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 <alexinbeijing@gmail.com>
---
 arch/m68k/kernel/process.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index c55ff71..92bf7b4 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -129,8 +129,11 @@ asmlinkage int m68k_clone(struct pt_regs *regs)
 		       (int __user *)regs->d3, (int __user *)regs->d4);
 }
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-		 unsigned long arg, struct task_struct *p)
+		 unsigned long kthread_arg, struct task_struct *p)
 {
 	struct fork_frame {
 		struct switch_stack sw;
@@ -153,11 +156,13 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 		memset(frame, 0, sizeof(struct fork_frame));
 		frame->regs.sr = PS_S;
 		frame->sw.a3 = usp; /* function */
-		frame->sw.d7 = arg;
+		frame->sw.d7 = kthread_arg;
 		frame->sw.retpc = (unsigned long)ret_from_kernel_thread;
 		p->thread.usp = 0;
 		return 0;
 	}
+
+	/* user thread */
 	memcpy(frame, container_of(current_pt_regs(), struct fork_frame, regs),
 		sizeof(struct fork_frame));
 	frame->regs.d0 = 0;
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 15/32] m68k: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
                   ` (3 preceding siblings ...)
  2015-03-13 18:14 ` [PATCH 15/32] m68k: " Alex Dowad
@ 2015-03-13 18:14 ` Alex Dowad
  2015-03-13 18:14   ` Alex Dowad
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Geert Uytterhoeven, open list:M68K ARCHITECTURE

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 <alexinbeijing@gmail.com>
---
 arch/m68k/kernel/process.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index c55ff71..92bf7b4 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -129,8 +129,11 @@ asmlinkage int m68k_clone(struct pt_regs *regs)
 		       (int __user *)regs->d3, (int __user *)regs->d4);
 }
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-		 unsigned long arg, struct task_struct *p)
+		 unsigned long kthread_arg, struct task_struct *p)
 {
 	struct fork_frame {
 		struct switch_stack sw;
@@ -153,11 +156,13 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 		memset(frame, 0, sizeof(struct fork_frame));
 		frame->regs.sr = PS_S;
 		frame->sw.a3 = usp; /* function */
-		frame->sw.d7 = arg;
+		frame->sw.d7 = kthread_arg;
 		frame->sw.retpc = (unsigned long)ret_from_kernel_thread;
 		p->thread.usp = 0;
 		return 0;
 	}
+
+	/* user thread */
 	memcpy(frame, container_of(current_pt_regs(), struct fork_frame, regs),
 		sizeof(struct fork_frame));
 	frame->regs.d0 = 0;
-- 
2.0.0.GIT

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
@ 2015-03-13 18:14   ` Alex Dowad
  2015-03-13 18:14   ` Alex Dowad
                     ` (20 subsequent siblings)
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: James Hogan, open list:METAG ARCHITECTURE

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 <alexinbeijing@gmail.com>
---
 arch/metag/kernel/process.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/metag/kernel/process.c b/arch/metag/kernel/process.c
index 483dff9..dcb4609 100644
--- a/arch/metag/kernel/process.c
+++ b/arch/metag/kernel/process.c
@@ -174,8 +174,11 @@ void show_regs(struct pt_regs *regs)
 	show_trace(NULL, (unsigned long *)regs->ctx.AX[0].U0, regs);
 }
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-		unsigned long arg, struct task_struct *tsk)
+		unsigned long kthread_arg, struct task_struct *tsk)
 {
 	struct pt_regs *childregs = task_pt_regs(tsk);
 	void *kernel_context = ((void *) childregs +
@@ -204,10 +207,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 		childregs->ctx.AX[0].U0 = (unsigned long) kernel_context;
 		/* Set D1Ar1=arg and D1RtP=usp (fn) */
 		childregs->ctx.DX[4].U1 = usp;
-		childregs->ctx.DX[3].U1 = arg;
+		childregs->ctx.DX[3].U1 = kthread_arg;
 		tsk->thread.int_depth = 2;
 		return 0;
 	}
+
 	/*
 	 * Get a pointer to where the new child's register block should have
 	 * been pushed.
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-13 18:14   ` Alex Dowad
  0 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: James Hogan, open list:METAG ARCHITECTURE

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 <alexinbeijing@gmail.com>
---
 arch/metag/kernel/process.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/metag/kernel/process.c b/arch/metag/kernel/process.c
index 483dff9..dcb4609 100644
--- a/arch/metag/kernel/process.c
+++ b/arch/metag/kernel/process.c
@@ -174,8 +174,11 @@ void show_regs(struct pt_regs *regs)
 	show_trace(NULL, (unsigned long *)regs->ctx.AX[0].U0, regs);
 }
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-		unsigned long arg, struct task_struct *tsk)
+		unsigned long kthread_arg, struct task_struct *tsk)
 {
 	struct pt_regs *childregs = task_pt_regs(tsk);
 	void *kernel_context = ((void *) childregs +
@@ -204,10 +207,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 		childregs->ctx.AX[0].U0 = (unsigned long) kernel_context;
 		/* Set D1Ar1=arg and D1RtP=usp (fn) */
 		childregs->ctx.DX[4].U1 = usp;
-		childregs->ctx.DX[3].U1 = arg;
+		childregs->ctx.DX[3].U1 = kthread_arg;
 		tsk->thread.int_depth = 2;
 		return 0;
 	}
+
 	/*
 	 * Get a pointer to where the new child's register block should have
 	 * been pushed.
-- 
2.0.0.GIT

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 17/32] microblaze: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
                   ` (5 preceding siblings ...)
  2015-03-13 18:14   ` Alex Dowad
@ 2015-03-13 18:14 ` Alex Dowad
  2015-03-13 18:14   ` Alex Dowad
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Michal Simek

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 <alexinbeijing@gmail.com>
---
 arch/microblaze/kernel/process.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c
index b2dd371..d4ecb98 100644
--- a/arch/microblaze/kernel/process.c
+++ b/arch/microblaze/kernel/process.c
@@ -51,20 +51,22 @@ void flush_thread(void)
 {
 }
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-		unsigned long arg, struct task_struct *p)
+		unsigned long kthread_arg, struct task_struct *p)
 {
 	struct pt_regs *childregs = task_pt_regs(p);
 	struct thread_info *ti = task_thread_info(p);
 
 	if (unlikely(p->flags & PF_KTHREAD)) {
-		/* if we're creating a new kernel thread then just zeroing all
-		 * the registers. That's OK for a brand new thread.*/
+		/* kernel thread: just zero all the registers */
 		memset(childregs, 0, sizeof(struct pt_regs));
 		memset(&ti->cpu_context, 0, sizeof(struct cpu_context));
 		ti->cpu_context.r1  = (unsigned long)childregs;
 		ti->cpu_context.r20 = (unsigned long)usp; /* fn */
-		ti->cpu_context.r19 = (unsigned long)arg;
+		ti->cpu_context.r19 = kthread_arg;
 		childregs->pt_mode = 1;
 		local_save_flags(childregs->msr);
 #ifdef CONFIG_MMU
@@ -73,6 +75,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 		ti->cpu_context.r15 = (unsigned long)ret_from_kernel_thread - 8;
 		return 0;
 	}
+
+	/* user thread */
 	*childregs = *current_pt_regs();
 	if (usp)
 		childregs->r1 = usp;
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 18/32] mips: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-13 18:14   ` Alex Dowad
  0 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ralf Baechle, Paul Burton, Alex Smith, Markos Chandras,
	James Hogan, Eunbong Song, open list:MIPS

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 <alexinbeijing@gmail.com>
---
 arch/mips/kernel/process.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index bf85cc1..d295bd1 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -107,8 +107,11 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
 	return 0;
 }
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-	unsigned long arg, struct task_struct *p)
+	unsigned long kthread_arg, struct task_struct *p)
 {
 	struct thread_info *ti = task_thread_info(p);
 	struct pt_regs *childregs, *regs = current_pt_regs();
@@ -123,11 +126,12 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 	childksp = (unsigned long) childregs;
 	p->thread.cp0_status = read_c0_status() & ~(ST0_CU2|ST0_CU1);
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		unsigned long status = p->thread.cp0_status;
 		memset(childregs, 0, sizeof(struct pt_regs));
 		ti->addr_limit = KERNEL_DS;
 		p->thread.reg16 = usp; /* fn */
-		p->thread.reg17 = arg;
+		p->thread.reg17 = kthread_arg;
 		p->thread.reg29 = childksp;
 		p->thread.reg31 = (unsigned long) ret_from_kernel_thread;
 #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
@@ -139,6 +143,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 		childregs->cp0_status = status;
 		return 0;
 	}
+
+	/* user thread */
 	*childregs = *regs;
 	childregs->regs[7] = 0; /* Clear error flag */
 	childregs->regs[2] = 0; /* Child gets zero as return value */
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 18/32] mips: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-13 18:14   ` Alex Dowad
  0 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ralf Baechle, Paul Burton, Alex Smith, Markos Chandras,
	James Hogan, Eunbong Song, open list:MIPS

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 <alexinbeijing@gmail.com>
---
 arch/mips/kernel/process.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index bf85cc1..d295bd1 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -107,8 +107,11 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
 	return 0;
 }
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-	unsigned long arg, struct task_struct *p)
+	unsigned long kthread_arg, struct task_struct *p)
 {
 	struct thread_info *ti = task_thread_info(p);
 	struct pt_regs *childregs, *regs = current_pt_regs();
@@ -123,11 +126,12 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 	childksp = (unsigned long) childregs;
 	p->thread.cp0_status = read_c0_status() & ~(ST0_CU2|ST0_CU1);
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		unsigned long status = p->thread.cp0_status;
 		memset(childregs, 0, sizeof(struct pt_regs));
 		ti->addr_limit = KERNEL_DS;
 		p->thread.reg16 = usp; /* fn */
-		p->thread.reg17 = arg;
+		p->thread.reg17 = kthread_arg;
 		p->thread.reg29 = childksp;
 		p->thread.reg31 = (unsigned long) ret_from_kernel_thread;
 #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
@@ -139,6 +143,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 		childregs->cp0_status = status;
 		return 0;
 	}
+
+	/* user thread */
 	*childregs = *regs;
 	childregs->regs[7] = 0; /* Clear error flag */
 	childregs->regs[2] = 0; /* Child gets zero as return value */
-- 
2.0.0.GIT

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 19/32] mn10300: copy_thread(): rename 'ustk_size' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
                   ` (7 preceding siblings ...)
  2015-03-13 18:14   ` Alex Dowad
@ 2015-03-13 18:14 ` Alex Dowad
  2015-03-13 18:14 ` [PATCH 20/32] nios2: copy_thread(): rename 'arg' " Alex Dowad
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel
  Cc: David Howells, Koichi Yasutake, moderated list:PANASONIC MN10300...

'ustk_size' is misleading, since this argument is never used for a user stack
size. Rather, it is an argument passed to the main function executed by a new
kernel thread. Therefore, rename it to 'kthread_arg'.

Signed-off-by: Alex Dowad <alexinbeijing@gmail.com>
---
 arch/mn10300/kernel/process.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/mn10300/kernel/process.c b/arch/mn10300/kernel/process.c
index 3707da5..d08a9b1 100644
--- a/arch/mn10300/kernel/process.c
+++ b/arch/mn10300/kernel/process.c
@@ -137,11 +137,10 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
 }
 
 /*
- * set up the kernel stack for a new thread and copy arch-specific thread
- * control information
+ * Copy architecture-specific thread state
  */
 int copy_thread(unsigned long clone_flags,
-		unsigned long c_usp, unsigned long ustk_size,
+		unsigned long c_usp, unsigned long kthread_arg,
 		struct task_struct *p)
 {
 	struct thread_info *ti = task_thread_info(p);
@@ -164,14 +163,17 @@ int copy_thread(unsigned long clone_flags,
 	p->thread.usp	= c_usp;
 
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		memset(c_regs, 0, sizeof(struct pt_regs));
 		c_regs->a0 = c_usp; /* function */
-		c_regs->d0 = ustk_size; /* argument */
+		c_regs->d0 = kthread_arg;
 		local_save_flags(c_regs->epsw);
 		c_regs->epsw |= EPSW_IE | EPSW_IM_7;
 		p->thread.pc	= (unsigned long) ret_from_kernel_thread;
 		return 0;
 	}
+
+	/* user thread */
 	*c_regs = *current_pt_regs();
 	if (c_usp)
 		c_regs->sp = c_usp;
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 20/32] nios2: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
                   ` (8 preceding siblings ...)
  2015-03-13 18:14 ` [PATCH 19/32] mn10300: copy_thread(): rename 'ustk_size' " Alex Dowad
@ 2015-03-13 18:14 ` Alex Dowad
  2015-03-13 18:14 ` [PATCH 21/32] openrisc: " Alex Dowad
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ley Foon Tan, moderated list:NIOS2 ARCHITECTURE

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 <alexinbeijing@gmail.com>
---
 arch/nios2/kernel/process.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/nios2/kernel/process.c b/arch/nios2/kernel/process.c
index 0e075b5..f5a0e28 100644
--- a/arch/nios2/kernel/process.c
+++ b/arch/nios2/kernel/process.c
@@ -97,8 +97,12 @@ void flush_thread(void)
 	set_fs(USER_DS);
 }
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags,
-		unsigned long usp, unsigned long arg, struct task_struct *p)
+		unsigned long usp, unsigned long kthread_arg,
+		struct task_struct *p)
 {
 	struct pt_regs *childregs = task_pt_regs(p);
 	struct pt_regs *regs;
@@ -107,11 +111,12 @@ int copy_thread(unsigned long clone_flags,
 		((struct switch_stack *)childregs) - 1;
 
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		memset(childstack, 0,
 			sizeof(struct switch_stack) + sizeof(struct pt_regs));
 
 		childstack->r16 = usp;		/* fn */
-		childstack->r17 = arg;
+		childstack->r17 = kthread_arg;
 		childstack->ra = (unsigned long) ret_from_kernel_thread;
 		childregs->estatus = STATUS_PIE;
 		childregs->sp = (unsigned long) childstack;
@@ -121,6 +126,7 @@ int copy_thread(unsigned long clone_flags,
 		return 0;
 	}
 
+	/* user thread */
 	regs = current_pt_regs();
 	*childregs = *regs;
 	childregs->r2 = 0;	/* Set the return value for the child. */
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 21/32] openrisc: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
                   ` (9 preceding siblings ...)
  2015-03-13 18:14 ` [PATCH 20/32] nios2: copy_thread(): rename 'arg' " Alex Dowad
@ 2015-03-13 18:14 ` Alex Dowad
  2015-03-13 18:14 ` [PATCH 22/32] parisc: " Alex Dowad
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jonas Bonn, moderated list:OPENRISC ARCHITEC...

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 <alexinbeijing@gmail.com>
---
 arch/openrisc/kernel/process.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c
index 386af25..59098c4 100644
--- a/arch/openrisc/kernel/process.c
+++ b/arch/openrisc/kernel/process.c
@@ -114,7 +114,7 @@ extern asmlinkage void ret_from_fork(void);
  * copy_thread
  * @clone_flags: flags
  * @usp: user stack pointer or fn for kernel thread
- * @arg: arg to fn for kernel thread; always NULL for userspace thread
+ * @kthread_arg: arg to fn for kernel thread; always NULL for userspace thread
  * @p: the newly created task
  * @regs: CPU context to copy for userspace thread; always NULL for kthread
  *
@@ -140,10 +140,9 @@ extern asmlinkage void ret_from_fork(void);
  * below); ret_from_fork will then continue its execution causing the
  * 'kernel thread' to return to userspace as a userspace thread.
  */
-
 int
 copy_thread(unsigned long clone_flags, unsigned long usp,
-	    unsigned long arg, struct task_struct *p)
+	    unsigned long kthread_arg, struct task_struct *p)
 {
 	struct pt_regs *userregs;
 	struct pt_regs *kregs;
@@ -165,10 +164,12 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
 	kregs = (struct pt_regs *)sp;
 
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		memset(kregs, 0, sizeof(struct pt_regs));
 		kregs->gpr[20] = usp; /* fn, kernel thread */
-		kregs->gpr[22] = arg;
+		kregs->gpr[22] = kthread_arg;
 	} else {
+		/* user thread */
 		*userregs = *current_pt_regs();
 
 		if (usp)
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 22/32] parisc: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
                   ` (10 preceding siblings ...)
  2015-03-13 18:14 ` [PATCH 21/32] openrisc: " Alex Dowad
@ 2015-03-13 18:14 ` Alex Dowad
  2015-03-13 18:14   ` Alex Dowad
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel
  Cc: James E.J. Bottomley, Helge Deller, open list:PARISC ARCHITECTURE

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 <alexinbeijing@gmail.com>
---
 arch/parisc/kernel/process.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 8a488c2..809905a 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -181,9 +181,12 @@ int dump_task_fpu (struct task_struct *tsk, elf_fpregset_t *r)
 	return 1;
 }
 
+/*
+ * Copy architecture-specific thread state
+ */
 int
 copy_thread(unsigned long clone_flags, unsigned long usp,
-	    unsigned long arg, struct task_struct *p)
+	    unsigned long kthread_arg, struct task_struct *p)
 {
 	struct pt_regs *cregs = &(p->thread.regs);
 	void *stack = task_stack_page(p);
@@ -195,11 +198,10 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
 	extern void * const child_return;
 
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		memset(cregs, 0, sizeof(struct pt_regs));
 		if (!usp) /* idle thread */
 			return 0;
-
-		/* kernel thread */
 		/* Must exit via ret_from_kernel_thread in order
 		 * to call schedule_tail()
 		 */
@@ -215,7 +217,7 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
 #else
 		cregs->gr[26] = usp;
 #endif
-		cregs->gr[25] = arg;
+		cregs->gr[25] = kthread_arg;
 	} else {
 		/* user thread */
 		/* usp must be word aligned.  This also prevents users from
-- 
2.0.0.GIT

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 23/32] powerpc: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
@ 2015-03-13 18:14   ` Alex Dowad
  2015-03-13 18:14   ` Alex Dowad
                     ` (20 subsequent siblings)
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Anton Blanchard, Paul Gortmaker, Christoph Lameter,
	Michael Neuling, Vineeth Vijayan, open list:LINUX FOR POWERPC...

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 <alexinbeijing@gmail.com>
---
 arch/powerpc/kernel/process.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index b4cc7be..febb50d 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1114,8 +1114,11 @@ static void setup_ksp_vsid(struct task_struct *p, unsigned long sp)
  */
 extern unsigned long dscr_default; /* defined in arch/powerpc/kernel/sysfs.c */
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-		unsigned long arg, struct task_struct *p)
+		unsigned long kthread_arg, struct task_struct *p)
 {
 	struct pt_regs *childregs, *kregs;
 	extern void ret_from_fork(void);
@@ -1127,6 +1130,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 	sp -= sizeof(struct pt_regs);
 	childregs = (struct pt_regs *) sp;
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		struct thread_info *ti = (void *)task_stack_page(p);
 		memset(childregs, 0, sizeof(struct pt_regs));
 		childregs->gpr[1] = sp + sizeof(struct pt_regs);
@@ -1137,11 +1141,12 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 		clear_tsk_thread_flag(p, TIF_32BIT);
 		childregs->softe = 1;
 #endif
-		childregs->gpr[15] = arg;
+		childregs->gpr[15] = kthread_arg;
 		p->thread.regs = NULL;	/* no user register state */
 		ti->flags |= _TIF_RESTOREALL;
 		f = ret_from_kernel_thread;
 	} else {
+		/* user thread */
 		struct pt_regs *regs = current_pt_regs();
 		CHECK_FULL_REGS(regs);
 		*childregs = *regs;
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 23/32] powerpc: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-13 18:14   ` Alex Dowad
  0 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel
  Cc: Michael Neuling, Paul Gortmaker, Paul Mackerras, Anton Blanchard,
	Vineeth Vijayan, Christoph Lameter,
	open list:LINUX FOR POWERPC...

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 <alexinbeijing@gmail.com>
---
 arch/powerpc/kernel/process.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index b4cc7be..febb50d 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1114,8 +1114,11 @@ static void setup_ksp_vsid(struct task_struct *p, unsigned long sp)
  */
 extern unsigned long dscr_default; /* defined in arch/powerpc/kernel/sysfs.c */
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-		unsigned long arg, struct task_struct *p)
+		unsigned long kthread_arg, struct task_struct *p)
 {
 	struct pt_regs *childregs, *kregs;
 	extern void ret_from_fork(void);
@@ -1127,6 +1130,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 	sp -= sizeof(struct pt_regs);
 	childregs = (struct pt_regs *) sp;
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		struct thread_info *ti = (void *)task_stack_page(p);
 		memset(childregs, 0, sizeof(struct pt_regs));
 		childregs->gpr[1] = sp + sizeof(struct pt_regs);
@@ -1137,11 +1141,12 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 		clear_tsk_thread_flag(p, TIF_32BIT);
 		childregs->softe = 1;
 #endif
-		childregs->gpr[15] = arg;
+		childregs->gpr[15] = kthread_arg;
 		p->thread.regs = NULL;	/* no user register state */
 		ti->flags |= _TIF_RESTOREALL;
 		f = ret_from_kernel_thread;
 	} else {
+		/* user thread */
 		struct pt_regs *regs = current_pt_regs();
 		CHECK_FULL_REGS(regs);
 		*childregs = *regs;
-- 
2.0.0.GIT

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 24/32] s390: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
@ 2015-03-13 18:14   ` Alex Dowad
  2015-03-13 18:14   ` Alex Dowad
                     ` (20 subsequent siblings)
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel
  Cc: Martin Schwidefsky, Heiko Carstens, supporter:S390,
	Hendrik Brueckner, open list:S390

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 <alexinbeijing@gmail.com>
---
 arch/s390/kernel/process.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 13fc097..a1ca7cf 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -87,8 +87,11 @@ void arch_release_task_struct(struct task_struct *tsk)
 }
 #endif
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long new_stackp,
-		unsigned long arg, struct task_struct *p)
+		unsigned long kthread_arg, struct task_struct *p)
 {
 	struct thread_info *ti;
 	struct fake_frame
@@ -127,12 +130,14 @@ int copy_thread(unsigned long clone_flags, unsigned long new_stackp,
 		frame->childregs.psw.addr = PSW_ADDR_AMODE |
 				(unsigned long) kernel_thread_starter;
 		frame->childregs.gprs[9] = new_stackp; /* function */
-		frame->childregs.gprs[10] = arg;
+		frame->childregs.gprs[10] = kthread_arg;
 		frame->childregs.gprs[11] = (unsigned long) do_exit;
 		frame->childregs.orig_gpr2 = -1;
 
 		return 0;
 	}
+
+	/* user thread */
 	frame->childregs = *current_pt_regs();
 	frame->childregs.gprs[2] = 0;	/* child returns 0 on fork. */
 	frame->childregs.flags = 0;
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 24/32] s390: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-13 18:14   ` Alex Dowad
  0 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel
  Cc: Martin Schwidefsky, Heiko Carstens, supporter:S390,
	Hendrik Brueckner, open list:S390

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 <alexinbeijing@gmail.com>
---
 arch/s390/kernel/process.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 13fc097..a1ca7cf 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -87,8 +87,11 @@ void arch_release_task_struct(struct task_struct *tsk)
 }
 #endif
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long new_stackp,
-		unsigned long arg, struct task_struct *p)
+		unsigned long kthread_arg, struct task_struct *p)
 {
 	struct thread_info *ti;
 	struct fake_frame
@@ -127,12 +130,14 @@ int copy_thread(unsigned long clone_flags, unsigned long new_stackp,
 		frame->childregs.psw.addr = PSW_ADDR_AMODE |
 				(unsigned long) kernel_thread_starter;
 		frame->childregs.gprs[9] = new_stackp; /* function */
-		frame->childregs.gprs[10] = arg;
+		frame->childregs.gprs[10] = kthread_arg;
 		frame->childregs.gprs[11] = (unsigned long) do_exit;
 		frame->childregs.orig_gpr2 = -1;
 
 		return 0;
 	}
+
+	/* user thread */
 	frame->childregs = *current_pt_regs();
 	frame->childregs.gprs[2] = 0;	/* child returns 0 on fork. */
 	frame->childregs.flags = 0;
-- 
2.0.0.GIT

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 25/32] score: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
                   ` (13 preceding siblings ...)
  2015-03-13 18:14   ` Alex Dowad
@ 2015-03-13 18:14 ` Alex Dowad
  2015-03-13 18:14   ` Alex Dowad
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Chen Liqin, Lennox Wu

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 <alexinbeijing@gmail.com>
---
 arch/score/kernel/process.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/score/kernel/process.c b/arch/score/kernel/process.c
index a1519ad3..a72d15f 100644
--- a/arch/score/kernel/process.c
+++ b/arch/score/kernel/process.c
@@ -66,10 +66,10 @@ void exit_thread(void) {}
 void flush_thread(void) {}
 
 /*
- * set up the kernel stack and exception frames for a new process
+ * Copy architecture-specific thread state
  */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-		unsigned long arg, struct task_struct *p)
+		unsigned long kthread_arg, struct task_struct *p)
 {
 	struct thread_info *ti = task_thread_info(p);
 	struct pt_regs *childregs = task_pt_regs(p);
@@ -77,11 +77,13 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 
 	p->thread.reg0 = (unsigned long) childregs;
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		memset(childregs, 0, sizeof(struct pt_regs));
 		p->thread.reg12 = usp;
-		p->thread.reg13 = arg;
+		p->thread.reg13 = kthread_arg;
 		p->thread.reg3 = (unsigned long) ret_from_kernel_thread;
 	} else {
+		/* user thread */
 		*childregs = *current_pt_regs();
 		childregs->regs[7] = 0;		/* Clear error flag */
 		childregs->regs[4] = 0;		/* Child gets zero as return value */
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 26/32] sh: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
@ 2015-03-13 18:14   ` Alex Dowad
  2015-03-13 18:14   ` Alex Dowad
                     ` (20 subsequent siblings)
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: open list:SUPERH

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 <alexinbeijing@gmail.com>
---
 arch/sh/kernel/process_32.c | 10 ++++++++--
 arch/sh/kernel/process_64.c | 12 +++++++++---
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c
index 2885fc9..fded1b4 100644
--- a/arch/sh/kernel/process_32.c
+++ b/arch/sh/kernel/process_32.c
@@ -123,8 +123,11 @@ EXPORT_SYMBOL(dump_fpu);
 asmlinkage void ret_from_fork(void);
 asmlinkage void ret_from_kernel_thread(void);
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-		unsigned long arg, struct task_struct *p)
+		unsigned long kthread_arg, struct task_struct *p)
 {
 	struct thread_info *ti = task_thread_info(p);
 	struct pt_regs *childregs;
@@ -146,9 +149,10 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 	childregs = task_pt_regs(p);
 	p->thread.sp = (unsigned long) childregs;
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		memset(childregs, 0, sizeof(struct pt_regs));
 		p->thread.pc = (unsigned long) ret_from_kernel_thread;
-		childregs->regs[4] = arg;
+		childregs->regs[4] = kthread_arg;
 		childregs->regs[5] = usp;
 		childregs->sr = SR_MD;
 #if defined(CONFIG_SH_FPU)
@@ -159,6 +163,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 		p->thread.fpu_counter = 0;
 		return 0;
 	}
+
+	/* user thread */
 	*childregs = *current_pt_regs();
 
 	if (usp)
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c
index e2062e6..693105d 100644
--- a/arch/sh/kernel/process_64.c
+++ b/arch/sh/kernel/process_64.c
@@ -371,8 +371,11 @@ EXPORT_SYMBOL(dump_fpu);
 asmlinkage void ret_from_fork(void);
 asmlinkage void ret_from_kernel_thread(void);
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-		unsigned long arg, struct task_struct *p)
+		unsigned long kthread_arg, struct task_struct *p)
 {
 	struct pt_regs *childregs;
 
@@ -391,14 +394,17 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 	p->thread.sp = (unsigned long) childregs;
 
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		memset(childregs, 0, sizeof(struct pt_regs));
-		childregs->regs[2] = (unsigned long)arg;
-		childregs->regs[3] = (unsigned long)usp;
+		childregs->regs[2] = kthread_arg;
+		childregs->regs[3] = usp;
 		childregs->sr = (1 << 30); /* not user_mode */
 		childregs->sr |= SR_FD; /* Invalidate FPU flag */
 		p->thread.pc = (unsigned long) ret_from_kernel_thread;
 		return 0;
 	}
+
+	/* user thread */
 	*childregs = *current_pt_regs();
 
 	/*
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 26/32] sh: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-13 18:14   ` Alex Dowad
  0 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: open list:SUPERH

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 <alexinbeijing@gmail.com>
---
 arch/sh/kernel/process_32.c | 10 ++++++++--
 arch/sh/kernel/process_64.c | 12 +++++++++---
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c
index 2885fc9..fded1b4 100644
--- a/arch/sh/kernel/process_32.c
+++ b/arch/sh/kernel/process_32.c
@@ -123,8 +123,11 @@ EXPORT_SYMBOL(dump_fpu);
 asmlinkage void ret_from_fork(void);
 asmlinkage void ret_from_kernel_thread(void);
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-		unsigned long arg, struct task_struct *p)
+		unsigned long kthread_arg, struct task_struct *p)
 {
 	struct thread_info *ti = task_thread_info(p);
 	struct pt_regs *childregs;
@@ -146,9 +149,10 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 	childregs = task_pt_regs(p);
 	p->thread.sp = (unsigned long) childregs;
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		memset(childregs, 0, sizeof(struct pt_regs));
 		p->thread.pc = (unsigned long) ret_from_kernel_thread;
-		childregs->regs[4] = arg;
+		childregs->regs[4] = kthread_arg;
 		childregs->regs[5] = usp;
 		childregs->sr = SR_MD;
 #if defined(CONFIG_SH_FPU)
@@ -159,6 +163,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 		p->thread.fpu_counter = 0;
 		return 0;
 	}
+
+	/* user thread */
 	*childregs = *current_pt_regs();
 
 	if (usp)
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c
index e2062e6..693105d 100644
--- a/arch/sh/kernel/process_64.c
+++ b/arch/sh/kernel/process_64.c
@@ -371,8 +371,11 @@ EXPORT_SYMBOL(dump_fpu);
 asmlinkage void ret_from_fork(void);
 asmlinkage void ret_from_kernel_thread(void);
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-		unsigned long arg, struct task_struct *p)
+		unsigned long kthread_arg, struct task_struct *p)
 {
 	struct pt_regs *childregs;
 
@@ -391,14 +394,17 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 	p->thread.sp = (unsigned long) childregs;
 
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		memset(childregs, 0, sizeof(struct pt_regs));
-		childregs->regs[2] = (unsigned long)arg;
-		childregs->regs[3] = (unsigned long)usp;
+		childregs->regs[2] = kthread_arg;
+		childregs->regs[3] = usp;
 		childregs->sr = (1 << 30); /* not user_mode */
 		childregs->sr |= SR_FD; /* Invalidate FPU flag */
 		p->thread.pc = (unsigned long) ret_from_kernel_thread;
 		return 0;
 	}
+
+	/* user thread */
 	*childregs = *current_pt_regs();
 
 	/*
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 27/32] sparc: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
@ 2015-03-13 18:14   ` Alex Dowad
  2015-03-13 18:14   ` Alex Dowad
                     ` (20 subsequent siblings)
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel
  Cc: David S. Miller, Sam Ravnborg, Aaron Tomlin, Don Zickus,
	open list:SPARC + UltraSPAR...

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 <alexinbeijing@gmail.com>
---
 arch/sparc/kernel/process_32.c | 10 ++++++++--
 arch/sparc/kernel/process_64.c |  6 ++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c
index 50e7b62..ba6492f 100644
--- a/arch/sparc/kernel/process_32.c
+++ b/arch/sparc/kernel/process_32.c
@@ -305,8 +305,11 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags,
 extern void ret_from_fork(void);
 extern void ret_from_kernel_thread(void);
 
+/*
+ * 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 thread_info *ti = task_thread_info(p);
 	struct pt_regs *childregs, *regs = current_pt_regs();
@@ -343,6 +346,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
 	p->thread.kregs = childregs;
 
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		extern int nwindows;
 		unsigned long psr;
 		memset(new_stack, 0, STACKFRAME_SZ + TRACEREG_SZ);
@@ -350,12 +354,14 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
 		p->thread.current_ds = KERNEL_DS;
 		ti->kpc = (((unsigned long) ret_from_kernel_thread) - 0x8);
 		childregs->u_regs[UREG_G1] = sp; /* function */
-		childregs->u_regs[UREG_G2] = arg;
+		childregs->u_regs[UREG_G2] = kthread_arg;
 		psr = childregs->psr = get_psr();
 		ti->kpsr = psr | PSR_PIL;
 		ti->kwim = 1 << (((psr & PSR_CWP) + 1) % nwindows);
 		return 0;
 	}
+
+	/* user thread */
 	memcpy(new_stack, (char *)regs - STACKFRAME_SZ, STACKFRAME_SZ + TRACEREG_SZ);
 	childregs->u_regs[UREG_FP] = sp;
 	p->thread.flags &= ~SPARC_FLAG_KTHREAD;
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c
index 0be7bf9..3f203c8 100644
--- a/arch/sparc/kernel/process_64.c
+++ b/arch/sparc/kernel/process_64.c
@@ -613,7 +613,7 @@ asmlinkage long sparc_do_fork(unsigned long clone_flags,
  * Child  -->  %o0 == parents pid, %o1 == 1
  */
 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 thread_info *t = task_thread_info(p);
 	struct pt_regs *regs = current_pt_regs();
@@ -633,15 +633,17 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
 	t->fpsaved[0] = 0;
 
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		memset(child_trap_frame, 0, child_stack_sz);
 		__thread_flag_byte_ptr(t)[TI_FLAG_BYTE_CWP] = 
 			(current_pt_regs()->tstate + 1) & TSTATE_CWP;
 		t->current_ds = ASI_P;
 		t->kregs->u_regs[UREG_G1] = sp; /* function */
-		t->kregs->u_regs[UREG_G2] = arg;
+		t->kregs->u_regs[UREG_G2] = kthread_arg;
 		return 0;
 	}
 
+	/* user thread */
 	parent_sf = ((struct sparc_stackf *) regs) - 1;
 	memcpy(child_trap_frame, parent_sf, child_stack_sz);
 	if (t->flags & _TIF_32BIT) {
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 27/32] sparc: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-13 18:14   ` Alex Dowad
  0 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel
  Cc: David S. Miller, Sam Ravnborg, Aaron Tomlin, Don Zickus,
	open list:SPARC + UltraSPAR...

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 <alexinbeijing@gmail.com>
---
 arch/sparc/kernel/process_32.c | 10 ++++++++--
 arch/sparc/kernel/process_64.c |  6 ++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c
index 50e7b62..ba6492f 100644
--- a/arch/sparc/kernel/process_32.c
+++ b/arch/sparc/kernel/process_32.c
@@ -305,8 +305,11 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags,
 extern void ret_from_fork(void);
 extern void ret_from_kernel_thread(void);
 
+/*
+ * 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 thread_info *ti = task_thread_info(p);
 	struct pt_regs *childregs, *regs = current_pt_regs();
@@ -343,6 +346,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
 	p->thread.kregs = childregs;
 
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		extern int nwindows;
 		unsigned long psr;
 		memset(new_stack, 0, STACKFRAME_SZ + TRACEREG_SZ);
@@ -350,12 +354,14 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
 		p->thread.current_ds = KERNEL_DS;
 		ti->kpc = (((unsigned long) ret_from_kernel_thread) - 0x8);
 		childregs->u_regs[UREG_G1] = sp; /* function */
-		childregs->u_regs[UREG_G2] = arg;
+		childregs->u_regs[UREG_G2] = kthread_arg;
 		psr = childregs->psr = get_psr();
 		ti->kpsr = psr | PSR_PIL;
 		ti->kwim = 1 << (((psr & PSR_CWP) + 1) % nwindows);
 		return 0;
 	}
+
+	/* user thread */
 	memcpy(new_stack, (char *)regs - STACKFRAME_SZ, STACKFRAME_SZ + TRACEREG_SZ);
 	childregs->u_regs[UREG_FP] = sp;
 	p->thread.flags &= ~SPARC_FLAG_KTHREAD;
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c
index 0be7bf9..3f203c8 100644
--- a/arch/sparc/kernel/process_64.c
+++ b/arch/sparc/kernel/process_64.c
@@ -613,7 +613,7 @@ asmlinkage long sparc_do_fork(unsigned long clone_flags,
  * Child  -->  %o0 = parents pid, %o1 = 1
  */
 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 thread_info *t = task_thread_info(p);
 	struct pt_regs *regs = current_pt_regs();
@@ -633,15 +633,17 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
 	t->fpsaved[0] = 0;
 
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		memset(child_trap_frame, 0, child_stack_sz);
 		__thread_flag_byte_ptr(t)[TI_FLAG_BYTE_CWP] = 
 			(current_pt_regs()->tstate + 1) & TSTATE_CWP;
 		t->current_ds = ASI_P;
 		t->kregs->u_regs[UREG_G1] = sp; /* function */
-		t->kregs->u_regs[UREG_G2] = arg;
+		t->kregs->u_regs[UREG_G2] = kthread_arg;
 		return 0;
 	}
 
+	/* user thread */
 	parent_sf = ((struct sparc_stackf *) regs) - 1;
 	memcpy(child_trap_frame, parent_sf, child_stack_sz);
 	if (t->flags & _TIF_32BIT) {
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 28/32] tile: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
                   ` (16 preceding siblings ...)
  2015-03-13 18:14   ` Alex Dowad
@ 2015-03-13 18:14 ` Alex Dowad
  2015-03-16 20:19   ` Chris Metcalf
  2015-03-13 18:14 ` [PATCH 29/32] um: " Alex Dowad
                   ` (3 subsequent siblings)
  21 siblings, 1 reply; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Chris Metcalf, Christoph Lameter, Joe Perches, Tejun Heo

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 <alexinbeijing@gmail.com>
---
 arch/tile/kernel/process.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c
index 48e5773..bff52e4 100644
--- a/arch/tile/kernel/process.c
+++ b/arch/tile/kernel/process.c
@@ -97,8 +97,11 @@ void arch_release_thread_info(struct thread_info *info)
 
 static void save_arch_state(struct thread_struct *t);
 
+/*
+ * 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);
 	unsigned long ksp;
@@ -130,15 +133,15 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
 		memset(&callee_regs[2], 0,
 		       (CALLEE_SAVED_REGS_COUNT - 2) * sizeof(unsigned long));
 		callee_regs[0] = sp;   /* r30 = function */
-		callee_regs[1] = arg;  /* r31 = arg */
+		callee_regs[1] = kthread_arg; /* r31 = arg */
 		childregs->ex1 = PL_ICS_EX1(KERNEL_PL, 0);
 		p->thread.pc = (unsigned long) ret_from_kernel_thread;
 		return 0;
 	}
 
 	/*
-	 * Start new thread in ret_from_fork so it schedules properly
-	 * and then return from interrupt like the parent.
+	 * user thread: start in ret_from_fork so it schedules properly
+	 * and then returns from interrupt like the parent.
 	 */
 	p->thread.pc = (unsigned long) ret_from_fork;
 
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 29/32] um: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
                   ` (17 preceding siblings ...)
  2015-03-13 18:14 ` [PATCH 28/32] tile: " Alex Dowad
@ 2015-03-13 18:14 ` Alex Dowad
  2015-03-13 18:14 ` [PATCH 30/32] unicore32: copy_thread(): rename 'stk_sz' " Alex Dowad
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jeff Dike, Richard Weinberger, Andrew Morton, David Howells,
	user-mode-linux-devel, user-mode-linux-user

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 <alexinbeijing@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


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 30/32] unicore32: copy_thread(): rename 'stk_sz' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
                   ` (18 preceding siblings ...)
  2015-03-13 18:14 ` [PATCH 29/32] um: " Alex Dowad
@ 2015-03-13 18:14 ` Alex Dowad
  2015-03-13 18:14 ` [PATCH 31/32] x86: copy_thread(): rename 'arg' " Alex Dowad
  2015-03-13 18:14 ` [PATCH 32/32] xtensa: " Alex Dowad
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Guan Xuetao, Chen Gang

'stk_sz' is misleading, since this argument is never used for a stack size.
Rather, it is an argument passed to the main function executed by a new
kernel thread. Therefore, rename it to 'kthread_arg'.

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

diff --git a/arch/unicore32/kernel/process.c b/arch/unicore32/kernel/process.c
index b008e99..11e19e0 100644
--- a/arch/unicore32/kernel/process.c
+++ b/arch/unicore32/kernel/process.c
@@ -227,9 +227,12 @@ void release_thread(struct task_struct *dead_task)
 asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
 asmlinkage void ret_from_kernel_thread(void) __asm__("ret_from_kernel_thread");
 
+/*
+ * Copy architecture-specific thread state
+ */
 int
 copy_thread(unsigned long clone_flags, unsigned long stack_start,
-	    unsigned long stk_sz, struct task_struct *p)
+	    unsigned long kthread_arg, struct task_struct *p)
 {
 	struct thread_info *thread = task_thread_info(p);
 	struct pt_regs *childregs = task_pt_regs(p);
@@ -237,11 +240,13 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start,
 	memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save));
 	thread->cpu_context.sp = (unsigned long)childregs;
 	if (unlikely(p->flags & PF_KTHREAD)) {
+		/* kernel thread */
 		thread->cpu_context.pc = (unsigned long)ret_from_kernel_thread;
 		thread->cpu_context.r4 = stack_start;
-		thread->cpu_context.r5 = stk_sz;
+		thread->cpu_context.r5 = kthread_arg;
 		memset(childregs, 0, sizeof(struct pt_regs));
 	} else {
+		/* user thread */
 		thread->cpu_context.pc = (unsigned long)ret_from_fork;
 		*childregs = *current_pt_regs();
 		childregs->UCreg_00 = 0;
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 31/32] x86: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
                   ` (19 preceding siblings ...)
  2015-03-13 18:14 ` [PATCH 30/32] unicore32: copy_thread(): rename 'stk_sz' " Alex Dowad
@ 2015-03-13 18:14 ` Alex Dowad
  2015-03-13 18:14 ` [PATCH 32/32] xtensa: " Alex Dowad
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	maintainer:X86 ARCHITECTURE...,
	Oleg Nesterov, Andy Lutomirski, Suresh Siddha, Andi Kleen

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 <alexinbeijing@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


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 32/32] xtensa: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
                   ` (20 preceding siblings ...)
  2015-03-13 18:14 ` [PATCH 31/32] x86: copy_thread(): rename 'arg' " Alex Dowad
@ 2015-03-13 18:14 ` Alex Dowad
  21 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-13 18:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Chris Zankel, Max Filippov, open list:TENSILICA XTENSA...

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@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* Re: [PATCH 13/32] ia64: copy_thread(): rename 'user_stack_size' argument to 'kthread_arg'
  2015-03-13 18:14   ` Alex Dowad
@ 2015-03-14 17:54     ` Alex Dowad
  -1 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-14 17:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: Tony Luck, Fenghua Yu, Tejun Heo, Christoph Lameter,
	Matt Fleming, open list:IA64 (Itanium) PL...

Sorry, this patch was in error. (I learned about the IA64-only clone2 
syscall too late.)

Please disregard. Thanks! Alex Dowad

On 13/03/15 20:14, Alex Dowad wrote:
> 'user_stack_size' is very misleading, since the argument is never used for the
> size of the user stack. Rather, it is an argument which is passed to the main
> function executed by a newly forked kernel thread. Hence, rename it to
> 'kthread_arg'.
>
> When forking a new user thread, the kernel thread arg was (uselessly) added
> to the new user stack pointer. This "worked", since the kernel thread arg is
> always zero when forking a user thread, but it was obviously not intended.
>
> Signed-off-by: Alex Dowad <alexinbeijing@gmail.com>
> ---
>   arch/ia64/kernel/process.c | 11 +++++++----
>   1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
> index b515149..d4a78da 100644
> --- a/arch/ia64/kernel/process.c
> +++ b/arch/ia64/kernel/process.c
> @@ -300,7 +300,7 @@ ia64_load_extra (struct task_struct *task)
>   }
>   
>   /*
> - * Copy the state of an ia-64 thread.
> + * Copy the architecture-specific state of an ia-64 thread.
>    *
>    * We get here through the following  call chain:
>    *
> @@ -332,7 +332,7 @@ ia64_load_extra (struct task_struct *task)
>    */
>   int
>   copy_thread(unsigned long clone_flags,
> -	     unsigned long user_stack_base, unsigned long user_stack_size,
> +	     unsigned long user_stack_base, unsigned long kthread_arg,
>   	     struct task_struct *p)
>   {
>   	extern char ia64_ret_from_clone;
> @@ -376,13 +376,14 @@ copy_thread(unsigned long clone_flags,
>   	ia64_drop_fpu(p);	/* don't pick up stale state from a CPU's fph */
>   
>   	if (unlikely(p->flags & PF_KTHREAD)) {
> +		/* kernel thread */
>   		if (unlikely(!user_stack_base)) {
>   			/* fork_idle() called us */
>   			return 0;
>   		}
>   		memset(child_stack, 0, sizeof(*child_ptregs) + sizeof(*child_stack));
>   		child_stack->r4 = user_stack_base;	/* payload */
> -		child_stack->r5 = user_stack_size;	/* argument */
> +		child_stack->r5 = kthread_arg;
>   		/*
>   		 * Preserve PSR bits, except for bits 32-34 and 37-45,
>   		 * which we can't read.
> @@ -406,6 +407,8 @@ copy_thread(unsigned long clone_flags,
>   
>   		return 0;
>   	}
> +
> +	/* user thread */
>   	stack = ((struct switch_stack *) regs) - 1;
>   	/* copy parent's switch_stack & pt_regs to child: */
>   	memcpy(child_stack, stack, sizeof(*child_ptregs) + sizeof(*child_stack));
> @@ -416,7 +419,7 @@ copy_thread(unsigned long clone_flags,
>   	if (clone_flags & CLONE_SETTLS)
>   		child_ptregs->r13 = regs->r16;	/* see sys_clone2() in entry.S */
>   	if (user_stack_base) {
> -		child_ptregs->r12 = user_stack_base + user_stack_size - 16;
> +		child_ptregs->r12 = user_stack_base - 16;
>   		child_ptregs->ar_bspstore = user_stack_base;
>   		child_ptregs->ar_rnat = 0;
>   		child_ptregs->loadrs = 0;


^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [PATCH 13/32] ia64: copy_thread(): rename 'user_stack_size' argument to 'kthread_arg'
@ 2015-03-14 17:54     ` Alex Dowad
  0 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-14 17:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: Tony Luck, Fenghua Yu, Tejun Heo, Christoph Lameter,
	Matt Fleming, open list:IA64 (Itanium) PL...

Sorry, this patch was in error. (I learned about the IA64-only clone2 
syscall too late.)

Please disregard. Thanks! Alex Dowad

On 13/03/15 20:14, Alex Dowad wrote:
> 'user_stack_size' is very misleading, since the argument is never used for the
> size of the user stack. Rather, it is an argument which is passed to the main
> function executed by a newly forked kernel thread. Hence, rename it to
> 'kthread_arg'.
>
> When forking a new user thread, the kernel thread arg was (uselessly) added
> to the new user stack pointer. This "worked", since the kernel thread arg is
> always zero when forking a user thread, but it was obviously not intended.
>
> Signed-off-by: Alex Dowad <alexinbeijing@gmail.com>
> ---
>   arch/ia64/kernel/process.c | 11 +++++++----
>   1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
> index b515149..d4a78da 100644
> --- a/arch/ia64/kernel/process.c
> +++ b/arch/ia64/kernel/process.c
> @@ -300,7 +300,7 @@ ia64_load_extra (struct task_struct *task)
>   }
>   
>   /*
> - * Copy the state of an ia-64 thread.
> + * Copy the architecture-specific state of an ia-64 thread.
>    *
>    * We get here through the following  call chain:
>    *
> @@ -332,7 +332,7 @@ ia64_load_extra (struct task_struct *task)
>    */
>   int
>   copy_thread(unsigned long clone_flags,
> -	     unsigned long user_stack_base, unsigned long user_stack_size,
> +	     unsigned long user_stack_base, unsigned long kthread_arg,
>   	     struct task_struct *p)
>   {
>   	extern char ia64_ret_from_clone;
> @@ -376,13 +376,14 @@ copy_thread(unsigned long clone_flags,
>   	ia64_drop_fpu(p);	/* don't pick up stale state from a CPU's fph */
>   
>   	if (unlikely(p->flags & PF_KTHREAD)) {
> +		/* kernel thread */
>   		if (unlikely(!user_stack_base)) {
>   			/* fork_idle() called us */
>   			return 0;
>   		}
>   		memset(child_stack, 0, sizeof(*child_ptregs) + sizeof(*child_stack));
>   		child_stack->r4 = user_stack_base;	/* payload */
> -		child_stack->r5 = user_stack_size;	/* argument */
> +		child_stack->r5 = kthread_arg;
>   		/*
>   		 * Preserve PSR bits, except for bits 32-34 and 37-45,
>   		 * which we can't read.
> @@ -406,6 +407,8 @@ copy_thread(unsigned long clone_flags,
>   
>   		return 0;
>   	}
> +
> +	/* user thread */
>   	stack = ((struct switch_stack *) regs) - 1;
>   	/* copy parent's switch_stack & pt_regs to child: */
>   	memcpy(child_stack, stack, sizeof(*child_ptregs) + sizeof(*child_stack));
> @@ -416,7 +419,7 @@ copy_thread(unsigned long clone_flags,
>   	if (clone_flags & CLONE_SETTLS)
>   		child_ptregs->r13 = regs->r16;	/* see sys_clone2() in entry.S */
>   	if (user_stack_base) {
> -		child_ptregs->r12 = user_stack_base + user_stack_size - 16;
> +		child_ptregs->r12 = user_stack_base - 16;
>   		child_ptregs->ar_bspstore = user_stack_base;
>   		child_ptregs->ar_rnat = 0;
>   		child_ptregs->loadrs = 0;


^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [PATCH 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14   ` Alex Dowad
@ 2015-03-16 11:39     ` James Hogan
  -1 siblings, 0 replies; 56+ messages in thread
From: James Hogan @ 2015-03-16 11:39 UTC (permalink / raw)
  To: Alex Dowad, linux-kernel; +Cc: METAG ARCHITECTURE, 

[-- Attachment #1: Type: text/plain, Size: 1880 bytes --]

On 13/03/15 18:14, Alex Dowad wrote:
> 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 <alexinbeijing@gmail.com>
> ---
>  arch/metag/kernel/process.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/metag/kernel/process.c b/arch/metag/kernel/process.c
> index 483dff9..dcb4609 100644
> --- a/arch/metag/kernel/process.c
> +++ b/arch/metag/kernel/process.c
> @@ -174,8 +174,11 @@ void show_regs(struct pt_regs *regs)
>  	show_trace(NULL, (unsigned long *)regs->ctx.AX[0].U0, regs);
>  }
>  
> +/*
> + * Copy architecture-specific thread state
> + */
>  int copy_thread(unsigned long clone_flags, unsigned long usp,
> -		unsigned long arg, struct task_struct *tsk)
> +		unsigned long kthread_arg, struct task_struct *tsk)
>  {
>  	struct pt_regs *childregs = task_pt_regs(tsk);
>  	void *kernel_context = ((void *) childregs +
> @@ -204,10 +207,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
>  		childregs->ctx.AX[0].U0 = (unsigned long) kernel_context;
>  		/* Set D1Ar1=arg and D1RtP=usp (fn) */

Please update this comment too (ctx.DX[3].U1 stores the D1Ar1 register).

Other than that:
Acked-by: James Hogan <james.hogan@imgtec.com>

I'll assume you plan to get all these patches merged together rather
than via individual arch trees unless you say otherwise.

Cheers
James

>  		childregs->ctx.DX[4].U1 = usp;
> -		childregs->ctx.DX[3].U1 = arg;
> +		childregs->ctx.DX[3].U1 = kthread_arg;
>  		tsk->thread.int_depth = 2;
>  		return 0;
>  	}
> +
>  	/*
>  	 * Get a pointer to where the new child's register block should have
>  	 * been pushed.
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [PATCH 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-16 11:39     ` James Hogan
  0 siblings, 0 replies; 56+ messages in thread
From: James Hogan @ 2015-03-16 11:39 UTC (permalink / raw)
  To: Alex Dowad, linux-kernel; +Cc: METAG ARCHITECTURE

[-- Attachment #1: Type: text/plain, Size: 1880 bytes --]

On 13/03/15 18:14, Alex Dowad wrote:
> 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 <alexinbeijing@gmail.com>
> ---
>  arch/metag/kernel/process.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/metag/kernel/process.c b/arch/metag/kernel/process.c
> index 483dff9..dcb4609 100644
> --- a/arch/metag/kernel/process.c
> +++ b/arch/metag/kernel/process.c
> @@ -174,8 +174,11 @@ void show_regs(struct pt_regs *regs)
>  	show_trace(NULL, (unsigned long *)regs->ctx.AX[0].U0, regs);
>  }
>  
> +/*
> + * Copy architecture-specific thread state
> + */
>  int copy_thread(unsigned long clone_flags, unsigned long usp,
> -		unsigned long arg, struct task_struct *tsk)
> +		unsigned long kthread_arg, struct task_struct *tsk)
>  {
>  	struct pt_regs *childregs = task_pt_regs(tsk);
>  	void *kernel_context = ((void *) childregs +
> @@ -204,10 +207,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
>  		childregs->ctx.AX[0].U0 = (unsigned long) kernel_context;
>  		/* Set D1Ar1=arg and D1RtP=usp (fn) */

Please update this comment too (ctx.DX[3].U1 stores the D1Ar1 register).

Other than that:
Acked-by: James Hogan <james.hogan@imgtec.com>

I'll assume you plan to get all these patches merged together rather
than via individual arch trees unless you say otherwise.

Cheers
James

>  		childregs->ctx.DX[4].U1 = usp;
> -		childregs->ctx.DX[3].U1 = arg;
> +		childregs->ctx.DX[3].U1 = kthread_arg;
>  		tsk->thread.int_depth = 2;
>  		return 0;
>  	}
> +
>  	/*
>  	 * Get a pointer to where the new child's register block should have
>  	 * been pushed.
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 56+ messages in thread

* [PATCHv2 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-16 11:39     ` James Hogan
  (?)
@ 2015-03-16 13:13     ` Alex Dowad
  2015-03-16 14:31         ` James Hogan
  -1 siblings, 1 reply; 56+ messages in thread
From: Alex Dowad @ 2015-03-16 13:13 UTC (permalink / raw)
  To: james.hogan; +Cc: linux-kernel, linux-metag

The 'arg' argument to copy_thread() is only ever used when forking a new
kernel thread. Hence, rename it to 'kthread_arg' for clarity.

Signed-off-by: Alex Dowad <alexinbeijing@gmail.com>
---

James Hogan,

Thanks for reviewing this patch. The comment has been updated as you suggested.

You said: "I'll assume you plan to get all these patches merged together rather than
via individual arch trees..." The truth is that I am as green as green can be and have
no idea how I plan to get these patches merged. I was just reading the Linux source and
saw what looked like an opportunity to make the code a tiny bit easier to read. If you
have any suggestions on how to proceed, please let me know.

Kind regards, Alex Dowad

 arch/metag/kernel/process.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/metag/kernel/process.c b/arch/metag/kernel/process.c
index 483dff9..dcb4609 100644
--- a/arch/metag/kernel/process.c
+++ b/arch/metag/kernel/process.c
@@ -174,8 +174,11 @@ void show_regs(struct pt_regs *regs)
 	show_trace(NULL, (unsigned long *)regs->ctx.AX[0].U0, regs);
 }
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-		unsigned long arg, struct task_struct *tsk)
+		unsigned long kthread_arg, struct task_struct *tsk)
 {
 	struct pt_regs *childregs = task_pt_regs(tsk);
 	void *kernel_context = ((void *) childregs +
@@ -204,10 +207,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 		childregs->ctx.AX[0].U0 = (unsigned long) kernel_context;
-   /* Set D1Ar1=arg and D1RtP=usp (fn) */
+ 	/* Set D1Ar1=kthread_arg and D1RtP=usp (fn) */
 		childregs->ctx.DX[4].U1 = usp;
-		childregs->ctx.DX[3].U1 = arg;
+		childregs->ctx.DX[3].U1 = kthread_arg;
 		tsk->thread.int_depth = 2;
 		return 0;
 	}
+
 	/*
 	 * Get a pointer to where the new child's register block should have
 	 * been pushed.
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* Re: [PATCHv2 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-16 13:13     ` [PATCHv2 " Alex Dowad
@ 2015-03-16 14:31         ` James Hogan
  0 siblings, 0 replies; 56+ messages in thread
From: James Hogan @ 2015-03-16 14:31 UTC (permalink / raw)
  To: Alex Dowad; +Cc: linux-kernel, linux-metag

[-- Attachment #1: Type: text/plain, Size: 1855 bytes --]

Hi Alex,

On 16/03/15 13:13, Alex Dowad wrote:
> The 'arg' argument to copy_thread() is only ever used when forking a new
> kernel thread. Hence, rename it to 'kthread_arg' for clarity.
> 
> Signed-off-by: Alex Dowad <alexinbeijing@gmail.com>
> ---
> 
> James Hogan,
> 
> Thanks for reviewing this patch. The comment has been updated as you suggested.
> 
> You said: "I'll assume you plan to get all these patches merged together rather than
> via individual arch trees..." The truth is that I am as green as green can be and have
> no idea how I plan to get these patches merged. I was just reading the Linux source and
> saw what looked like an opportunity to make the code a tiny bit easier to read. If you
> have any suggestions on how to proceed, please let me know.

I guess there are 3 main paths:
1) Ask individual arch maintainers to apply the patches if possible,
since it doesn't have dependencies on other patches you're submitting.
2) Gather acks from maintainers for the remaining patches and ask Andrew
Morton or another relevant maintainer to apply them (Andrew often picks
up misc patches like this I believe).
3) Or gather acks for remaining patches and send a pull request to Linus
yourself during the next merge window.


Btw, the whitespace seems to be corrupted here, so the patch won't apply:

> -   /* Set D1Ar1=arg and D1RtP=usp (fn) */

^^^ currently this is indented with tabs not spaces

> + 	/* Set D1Ar1=kthread_arg and D1RtP=usp (fn) */

^^^ and this has a space before a tab

Cheers
James


>  		childregs->ctx.DX[4].U1 = usp;
> -		childregs->ctx.DX[3].U1 = arg;
> +		childregs->ctx.DX[3].U1 = kthread_arg;
>  		tsk->thread.int_depth = 2;
>  		return 0;
>  	}
> +
>  	/*
>  	 * Get a pointer to where the new child's register block should have
>  	 * been pushed.
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [PATCHv2 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-16 14:31         ` James Hogan
  0 siblings, 0 replies; 56+ messages in thread
From: James Hogan @ 2015-03-16 14:31 UTC (permalink / raw)
  To: Alex Dowad; +Cc: linux-kernel, linux-metag

[-- Attachment #1: Type: text/plain, Size: 1855 bytes --]

Hi Alex,

On 16/03/15 13:13, Alex Dowad wrote:
> The 'arg' argument to copy_thread() is only ever used when forking a new
> kernel thread. Hence, rename it to 'kthread_arg' for clarity.
> 
> Signed-off-by: Alex Dowad <alexinbeijing@gmail.com>
> ---
> 
> James Hogan,
> 
> Thanks for reviewing this patch. The comment has been updated as you suggested.
> 
> You said: "I'll assume you plan to get all these patches merged together rather than
> via individual arch trees..." The truth is that I am as green as green can be and have
> no idea how I plan to get these patches merged. I was just reading the Linux source and
> saw what looked like an opportunity to make the code a tiny bit easier to read. If you
> have any suggestions on how to proceed, please let me know.

I guess there are 3 main paths:
1) Ask individual arch maintainers to apply the patches if possible,
since it doesn't have dependencies on other patches you're submitting.
2) Gather acks from maintainers for the remaining patches and ask Andrew
Morton or another relevant maintainer to apply them (Andrew often picks
up misc patches like this I believe).
3) Or gather acks for remaining patches and send a pull request to Linus
yourself during the next merge window.


Btw, the whitespace seems to be corrupted here, so the patch won't apply:

> -   /* Set D1Ar1=arg and D1RtP=usp (fn) */

^^^ currently this is indented with tabs not spaces

> + 	/* Set D1Ar1=kthread_arg and D1RtP=usp (fn) */

^^^ and this has a space before a tab

Cheers
James


>  		childregs->ctx.DX[4].U1 = usp;
> -		childregs->ctx.DX[3].U1 = arg;
> +		childregs->ctx.DX[3].U1 = kthread_arg;
>  		tsk->thread.int_depth = 2;
>  		return 0;
>  	}
> +
>  	/*
>  	 * Get a pointer to where the new child's register block should have
>  	 * been pushed.
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [PATCHv2 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-16 14:31         ` James Hogan
  (?)
@ 2015-03-16 14:38         ` Alex Dowad
  -1 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-16 14:38 UTC (permalink / raw)
  To: James Hogan; +Cc: linux-kernel, linux-metag


On 16/03/15 16:31, James Hogan wrote:
> Hi Alex,
>
> On 16/03/15 13:13, Alex Dowad wrote:
>> The 'arg' argument to copy_thread() is only ever used when forking a new
>> kernel thread. Hence, rename it to 'kthread_arg' for clarity.
>>
>> Signed-off-by: Alex Dowad <alexinbeijing@gmail.com>
>> ---
>>
>> James Hogan,
>>
>> Thanks for reviewing this patch. The comment has been updated as you suggested.
>>
>> You said: "I'll assume you plan to get all these patches merged together rather than
>> via individual arch trees..." The truth is that I am as green as green can be and have
>> no idea how I plan to get these patches merged. I was just reading the Linux source and
>> saw what looked like an opportunity to make the code a tiny bit easier to read. If you
>> have any suggestions on how to proceed, please let me know.
> I guess there are 3 main paths:
> 1) Ask individual arch maintainers to apply the patches if possible,
> since it doesn't have dependencies on other patches you're submitting.
> 2) Gather acks from maintainers for the remaining patches and ask Andrew
> Morton or another relevant maintainer to apply them (Andrew often picks
> up misc patches like this I believe).
> 3) Or gather acks for remaining patches and send a pull request to Linus
> yourself during the next merge window.
>
>
> Btw, the whitespace seems to be corrupted here, so the patch won't apply:
Grrr. Sending again.

Thanks for the pointers on merge workflow. I doubt that I will get the 
attention of each and every arch maintainer, but let's see what will 
happen. Thanks again.

>
>> -   /* Set D1Ar1=arg and D1RtP=usp (fn) */
> ^^^ currently this is indented with tabs not spaces
>
>> + 	/* Set D1Ar1=kthread_arg and D1RtP=usp (fn) */
> ^^^ and this has a space before a tab
>
> Cheers
> James

^ permalink raw reply	[flat|nested] 56+ messages in thread

* [PATCHv3 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-16 14:31         ` James Hogan
  (?)
  (?)
@ 2015-03-16 14:38         ` Alex Dowad
  2015-03-16 14:52             ` James Hogan
  -1 siblings, 1 reply; 56+ messages in thread
From: Alex Dowad @ 2015-03-16 14:38 UTC (permalink / raw)
  To: james.hogan; +Cc: linux-kernel, linux-metag

The 'arg' argument to copy_thread() is only ever used when forking a new
kernel thread. Hence, rename it to 'kthread_arg' for clarity.

Signed-off-by: Alex Dowad <alexinbeijing@gmail.com>
---

Fixed problem with whitespace, sending again. AD

 arch/metag/kernel/process.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/metag/kernel/process.c b/arch/metag/kernel/process.c
index 483dff9..dcb4609 100644
--- a/arch/metag/kernel/process.c
+++ b/arch/metag/kernel/process.c
@@ -174,8 +174,11 @@ void show_regs(struct pt_regs *regs)
 	show_trace(NULL, (unsigned long *)regs->ctx.AX[0].U0, regs);
 }
 
+/*
+ * Copy architecture-specific thread state
+ */
 int copy_thread(unsigned long clone_flags, unsigned long usp,
-		unsigned long arg, struct task_struct *tsk)
+		unsigned long kthread_arg, struct task_struct *tsk)
 {
 	struct pt_regs *childregs = task_pt_regs(tsk);
 	void *kernel_context = ((void *) childregs +
@@ -204,10 +207,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 		childregs->ctx.AX[0].U0 = (unsigned long) kernel_context;
-		/* Set D1Ar1=arg and D1RtP=usp (fn) */
+ 	/* Set D1Ar1=kthread_arg and D1RtP=usp (fn) */
 		childregs->ctx.DX[4].U1 = usp;
-		childregs->ctx.DX[3].U1 = arg;
+		childregs->ctx.DX[3].U1 = kthread_arg;
 		tsk->thread.int_depth = 2;
 		return 0;
 	}
+
 	/*
 	 * Get a pointer to where the new child's register block should have
 	 * been pushed.
-- 
2.0.0.GIT


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* Re: [PATCHv3 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-16 14:52             ` James Hogan
  0 siblings, 0 replies; 56+ messages in thread
From: James Hogan @ 2015-03-16 14:52 UTC (permalink / raw)
  To: Alex Dowad; +Cc: linux-kernel, linux-metag

[-- Attachment #1: Type: text/plain, Size: 1779 bytes --]

On 16/03/15 14:38, Alex Dowad wrote:
> The 'arg' argument to copy_thread() is only ever used when forking a new
> kernel thread. Hence, rename it to 'kthread_arg' for clarity.
> 
> Signed-off-by: Alex Dowad <alexinbeijing@gmail.com>
> ---
> 
> Fixed problem with whitespace, sending again. AD
> 
>  arch/metag/kernel/process.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/metag/kernel/process.c b/arch/metag/kernel/process.c
> index 483dff9..dcb4609 100644
> --- a/arch/metag/kernel/process.c
> +++ b/arch/metag/kernel/process.c
> @@ -174,8 +174,11 @@ void show_regs(struct pt_regs *regs)
>  	show_trace(NULL, (unsigned long *)regs->ctx.AX[0].U0, regs);
>  }
>  
> +/*
> + * Copy architecture-specific thread state
> + */
>  int copy_thread(unsigned long clone_flags, unsigned long usp,
> -		unsigned long arg, struct task_struct *tsk)
> +		unsigned long kthread_arg, struct task_struct *tsk)
>  {
>  	struct pt_regs *childregs = task_pt_regs(tsk);
>  	void *kernel_context = ((void *) childregs +
> @@ -204,10 +207,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
>  		childregs->ctx.AX[0].U0 = (unsigned long) kernel_context;
> -		/* Set D1Ar1=arg and D1RtP=usp (fn) */
> + 	/* Set D1Ar1=kthread_arg and D1RtP=usp (fn) */

FYI this still has a space before the tab, and isn't indented to the
same level as the surrounding code, but I'll just fix that up when I
apply it.

Thanks
James

>  		childregs->ctx.DX[4].U1 = usp;
> -		childregs->ctx.DX[3].U1 = arg;
> +		childregs->ctx.DX[3].U1 = kthread_arg;
>  		tsk->thread.int_depth = 2;
>  		return 0;
>  	}
> +
>  	/*
>  	 * Get a pointer to where the new child's register block should have
>  	 * been pushed.
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [PATCHv3 16/32] metag: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-16 14:52             ` James Hogan
  0 siblings, 0 replies; 56+ messages in thread
From: James Hogan @ 2015-03-16 14:52 UTC (permalink / raw)
  To: Alex Dowad
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-metag-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1809 bytes --]

On 16/03/15 14:38, Alex Dowad wrote:
> The 'arg' argument to copy_thread() is only ever used when forking a new
> kernel thread. Hence, rename it to 'kthread_arg' for clarity.
> 
> Signed-off-by: Alex Dowad <alexinbeijing-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> 
> Fixed problem with whitespace, sending again. AD
> 
>  arch/metag/kernel/process.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/metag/kernel/process.c b/arch/metag/kernel/process.c
> index 483dff9..dcb4609 100644
> --- a/arch/metag/kernel/process.c
> +++ b/arch/metag/kernel/process.c
> @@ -174,8 +174,11 @@ void show_regs(struct pt_regs *regs)
>  	show_trace(NULL, (unsigned long *)regs->ctx.AX[0].U0, regs);
>  }
>  
> +/*
> + * Copy architecture-specific thread state
> + */
>  int copy_thread(unsigned long clone_flags, unsigned long usp,
> -		unsigned long arg, struct task_struct *tsk)
> +		unsigned long kthread_arg, struct task_struct *tsk)
>  {
>  	struct pt_regs *childregs = task_pt_regs(tsk);
>  	void *kernel_context = ((void *) childregs +
> @@ -204,10 +207,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
>  		childregs->ctx.AX[0].U0 = (unsigned long) kernel_context;
> -		/* Set D1Ar1=arg and D1RtP=usp (fn) */
> + 	/* Set D1Ar1=kthread_arg and D1RtP=usp (fn) */

FYI this still has a space before the tab, and isn't indented to the
same level as the surrounding code, but I'll just fix that up when I
apply it.

Thanks
James

>  		childregs->ctx.DX[4].U1 = usp;
> -		childregs->ctx.DX[3].U1 = arg;
> +		childregs->ctx.DX[3].U1 = kthread_arg;
>  		tsk->thread.int_depth = 2;
>  		return 0;
>  	}
> +
>  	/*
>  	 * Get a pointer to where the new child's register block should have
>  	 * been pushed.
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [PATCH 12/32] hexagon: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14   ` Alex Dowad
  (?)
@ 2015-03-16 16:25   ` rkuo
  -1 siblings, 0 replies; 56+ messages in thread
From: rkuo @ 2015-03-16 16:25 UTC (permalink / raw)
  To: Alex Dowad; +Cc: linux-kernel, open list:QUALCOMM HEXAGON...

On Fri, Mar 13, 2015 at 08:14:35PM +0200, Alex Dowad wrote:
> 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 <alexinbeijing@gmail.com>
> ---
>  arch/hexagon/kernel/process.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/hexagon/kernel/process.c b/arch/hexagon/kernel/process.c
> index 0a0dd5c..6f27358 100644
> --- a/arch/hexagon/kernel/process.c
> +++ b/arch/hexagon/kernel/process.c
> @@ -71,7 +71,7 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
>   * Copy architecture-specific thread state
>   */
>  int copy_thread(unsigned long clone_flags, unsigned long usp,
> -		unsigned long arg, struct task_struct *p)
> +		unsigned long kthread_arg, struct task_struct *p)
>  {
>  	struct thread_info *ti = task_thread_info(p);
>  	struct hexagon_switch_stack *ss;
> @@ -94,10 +94,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
>  	ss->lr = (unsigned long)ret_from_fork;
>  	p->thread.switch_sp = ss;
>  	if (unlikely(p->flags & PF_KTHREAD)) {
> +		/* kernel thread */
>  		memset(childregs, 0, sizeof(struct pt_regs));
>  		/* r24 <- fn, r25 <- arg */
>  		ss->r24 = usp;
> -		ss->r25 = arg;
> +		ss->r25 = kthread_arg;
>  		pt_set_kmode(childregs);
>  		return 0;
>  	}
> -- 
> 2.0.0.GIT
> 

Acked-by: Richard Kuo <rkuo@codeaurora.org>



-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, 
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [PATCH 28/32] tile: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14 ` [PATCH 28/32] tile: " Alex Dowad
@ 2015-03-16 20:19   ` Chris Metcalf
  2015-03-16 20:44     ` Alex Dowad
  0 siblings, 1 reply; 56+ messages in thread
From: Chris Metcalf @ 2015-03-16 20:19 UTC (permalink / raw)
  To: Alex Dowad, linux-kernel; +Cc: Christoph Lameter, Joe Perches, Tejun Heo

On 3/13/2015 2:14 PM, Alex Dowad wrote:
> 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<alexinbeijing@gmail.com>
> ---
>   arch/tile/kernel/process.c | 11 +++++++----
>   1 file changed, 7 insertions(+), 4 deletions(-)

Acked-by: Chris Metcalf <cmetcalf@ezchip.com>

If you would prefer me to take this into the tile tree, let me know, and I am happy to do so.

-- 
Chris Metcalf, EZChip Semiconductor
http://www.ezchip.com


^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [PATCH 28/32] tile: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-16 20:19   ` Chris Metcalf
@ 2015-03-16 20:44     ` Alex Dowad
  2015-03-19 18:06       ` Chris Metcalf
  0 siblings, 1 reply; 56+ messages in thread
From: Alex Dowad @ 2015-03-16 20:44 UTC (permalink / raw)
  To: Chris Metcalf, linux-kernel; +Cc: Christoph Lameter, Joe Perches, Tejun Heo


On 16/03/15 22:19, Chris Metcalf wrote:
> On 3/13/2015 2:14 PM, Alex Dowad wrote:
>> 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<alexinbeijing@gmail.com>
>> ---
>>   arch/tile/kernel/process.c | 11 +++++++----
>>   1 file changed, 7 insertions(+), 4 deletions(-)
>
> Acked-by: Chris Metcalf <cmetcalf@ezchip.com>
>
> If you would prefer me to take this into the tile tree, let me know, 
> and I am happy to do so.
>
Hi Chris,

Thanks for your kind offer. I am a 100% genuine true-blue kernel newbie 
and have no idea whether a change like this should be merged 
individually by each arch maintainer, or all together at some point 
upstream (or is it downstream? I'm not sure about my streams). Do you 
have any suggestion?

Thank you again! AD

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [23/32] powerpc: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-13 18:14   ` Alex Dowad
@ 2015-03-19  6:45     ` Michael Ellerman
  -1 siblings, 0 replies; 56+ messages in thread
From: Michael Ellerman @ 2015-03-19  6:45 UTC (permalink / raw)
  To: Alex Dowad, linux-kernel
  Cc: Michael Neuling, Paul Gortmaker, Paul Mackerras, Anton Blanchard,
	Vineeth Vijayan, Christoph Lameter,
	open list:LINUX FOR POWERPC...

On Fri, 2015-13-03 at 18:14:46 UTC, Alex Dowad wrote:
> 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()).
 
I don't understand the bit about consistency with do_fork() ?

Otherwise it looks fine.

cheers

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [23/32] powerpc: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-19  6:45     ` Michael Ellerman
  0 siblings, 0 replies; 56+ messages in thread
From: Michael Ellerman @ 2015-03-19  6:45 UTC (permalink / raw)
  To: Alex Dowad, linux-kernel
  Cc: Michael Neuling, Paul Gortmaker, Vineeth Vijayan,
	Anton Blanchard, Paul Mackerras, Christoph Lameter,
	open list:LINUX FOR POWERPC...

On Fri, 2015-13-03 at 18:14:46 UTC, Alex Dowad wrote:
> 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()).
 
I don't understand the bit about consistency with do_fork() ?

Otherwise it looks fine.

cheers

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [23/32] powerpc: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-19  6:45     ` Michael Ellerman
@ 2015-03-19  7:22       ` Alex Dowad
  -1 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-19  7:22 UTC (permalink / raw)
  To: Michael Ellerman, linux-kernel
  Cc: Michael Neuling, Paul Gortmaker, Paul Mackerras, Anton Blanchard,
	Vineeth Vijayan, Christoph Lameter,
	open list:LINUX FOR POWERPC...


On 19/03/15 08:45, Michael Ellerman wrote:
> On Fri, 2015-13-03 at 18:14:46 UTC, Alex Dowad wrote:
>> 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()).
>   
> I don't understand the bit about consistency with do_fork() ?
This series of patches includes one patch which renames the arg for 
do_fork(), and others which rename the same arg for each arch-specific 
implementation of copy_thread(). So if all of them are accepted and 
merged, then all will be consistent. If only some of the patches are 
accepted, I will rewrite the commit message so it doesn't mention 
"consistency".

Thanks! AD
>
> Otherwise it looks fine.
>
> cheers


^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [23/32] powerpc: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-19  7:22       ` Alex Dowad
  0 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-19  7:22 UTC (permalink / raw)
  To: Michael Ellerman, linux-kernel
  Cc: Michael Neuling, Paul Gortmaker, Vineeth Vijayan,
	Anton Blanchard, Paul Mackerras, Christoph Lameter,
	open list:LINUX FOR POWERPC...


On 19/03/15 08:45, Michael Ellerman wrote:
> On Fri, 2015-13-03 at 18:14:46 UTC, Alex Dowad wrote:
>> 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()).
>   
> I don't understand the bit about consistency with do_fork() ?
This series of patches includes one patch which renames the arg for 
do_fork(), and others which rename the same arg for each arch-specific 
implementation of copy_thread(). So if all of them are accepted and 
merged, then all will be consistent. If only some of the patches are 
accepted, I will rewrite the commit message so it doesn't mention 
"consistency".

Thanks! AD
>
> Otherwise it looks fine.
>
> cheers

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [PATCH 28/32] tile: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-16 20:44     ` Alex Dowad
@ 2015-03-19 18:06       ` Chris Metcalf
  0 siblings, 0 replies; 56+ messages in thread
From: Chris Metcalf @ 2015-03-19 18:06 UTC (permalink / raw)
  To: Alex Dowad, linux-kernel
  Cc: Christoph Lameter, Joe Perches, Tejun Heo, james hogan

On 03/16/2015 04:44 PM, Alex Dowad wrote:
>
> On 16/03/15 22:19, Chris Metcalf wrote:
>> On 3/13/2015 2:14 PM, Alex Dowad wrote:
>>> 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<alexinbeijing@gmail.com>
>>> ---
>>>   arch/tile/kernel/process.c | 11 +++++++----
>>>   1 file changed, 7 insertions(+), 4 deletions(-)
>>
>> Acked-by: Chris Metcalf <cmetcalf@ezchip.com>
>>
>> If you would prefer me to take this into the tile tree, let me know, 
>> and I am happy to do so.
>>
> Hi Chris,
>
> Thanks for your kind offer. I am a 100% genuine true-blue kernel 
> newbie and have no idea whether a change like this should be merged 
> individually by each arch maintainer, or all together at some point 
> upstream (or is it downstream? I'm not sure about my streams). Do you 
> have any suggestion?
>
> Thank you again! AD

I think James Hogan's replies were on-target [1].  My sense is that 
since it's a cleanup, and since you're trying for consistency, if you 
can gather up a few Acked-by's from maintainers, it probably makes sense 
to have it taken as a series.

[1] https://lkml.org/lkml/2015/3/16/477

-- 
Chris Metcalf, EZChip Semiconductor
http://www.ezchip.com


^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [23/32] powerpc: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-19  7:22       ` Alex Dowad
@ 2015-03-19 23:54         ` Michael Ellerman
  -1 siblings, 0 replies; 56+ messages in thread
From: Michael Ellerman @ 2015-03-19 23:54 UTC (permalink / raw)
  To: Alex Dowad
  Cc: linux-kernel, Michael Neuling, Paul Gortmaker, Paul Mackerras,
	Anton Blanchard, Vineeth Vijayan, Christoph Lameter,
	open list:LINUX FOR POWERPC...

On Thu, 2015-03-19 at 09:22 +0200, Alex Dowad wrote:
> On 19/03/15 08:45, Michael Ellerman wrote:
> > On Fri, 2015-13-03 at 18:14:46 UTC, Alex Dowad wrote:
> >> 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()).
> >   
> > I don't understand the bit about consistency with do_fork() ?

> This series of patches includes one patch which renames the arg for 
> do_fork(), and others which rename the same arg for each arch-specific 
> implementation of copy_thread(). So if all of them are accepted and 
> merged, then all will be consistent. If only some of the patches are 
> accepted, I will rewrite the commit message so it doesn't mention 
> "consistency".

Ah OK, I only got patch 23, so I missed the context of the whole series.

I'll apply this one to the powerpc tree.

cheers



^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [23/32] powerpc: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-19 23:54         ` Michael Ellerman
  0 siblings, 0 replies; 56+ messages in thread
From: Michael Ellerman @ 2015-03-19 23:54 UTC (permalink / raw)
  To: Alex Dowad
  Cc: Michael Neuling, linux-kernel, Paul Gortmaker, Vineeth Vijayan,
	Anton Blanchard, Paul Mackerras, Christoph Lameter,
	open list:LINUX FOR POWERPC...

On Thu, 2015-03-19 at 09:22 +0200, Alex Dowad wrote:
> On 19/03/15 08:45, Michael Ellerman wrote:
> > On Fri, 2015-13-03 at 18:14:46 UTC, Alex Dowad wrote:
> >> 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()).
> >   
> > I don't understand the bit about consistency with do_fork() ?

> This series of patches includes one patch which renames the arg for 
> do_fork(), and others which rename the same arg for each arch-specific 
> implementation of copy_thread(). So if all of them are accepted and 
> merged, then all will be consistent. If only some of the patches are 
> accepted, I will rewrite the commit message so it doesn't mention 
> "consistency".

Ah OK, I only got patch 23, so I missed the context of the whole series.

I'll apply this one to the powerpc tree.

cheers

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [23/32] powerpc: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-19 23:54         ` Michael Ellerman
@ 2015-03-24 19:49           ` Alex Dowad
  -1 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-24 19:49 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linux-kernel, Michael Neuling, Paul Gortmaker, Paul Mackerras,
	Anton Blanchard, Vineeth Vijayan, Christoph Lameter,
	open list:LINUX FOR POWERPC...

On 20/03/15 01:54, Michael Ellerman wrote:
> On Thu, 2015-03-19 at 09:22 +0200, Alex Dowad wrote:
>> On 19/03/15 08:45, Michael Ellerman wrote:
>>> On Fri, 2015-13-03 at 18:14:46 UTC, Alex Dowad wrote:
>>>> 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()).
>>>    
>>> I don't understand the bit about consistency with do_fork() ?
>>>
>> This series of patches includes one patch which renames the arg for
>> do_fork(), and others which rename the same arg for each arch-specific
>> implementation of copy_thread(). So if all of them are accepted and
>> merged, then all will be consistent. If only some of the patches are
>> accepted, I will rewrite the commit message so it doesn't mention
>> "consistency".
> Ah OK, I only got patch 23, so I missed the context of the whole series.
>
> I'll apply this one to the powerpc tree.
>
Dear M. Ellerman, sorry for not replying promptly. If you would like to 
apply this directly to the powerpc tree, that is fine, but can I edit 
the commit message to remove the mention of 'consistency'? I doubt that 
all 30+ archs will ever merge this change. Thanks, Alex

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [23/32] powerpc: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-24 19:49           ` Alex Dowad
  0 siblings, 0 replies; 56+ messages in thread
From: Alex Dowad @ 2015-03-24 19:49 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Michael Neuling, linux-kernel, Paul Gortmaker, Vineeth Vijayan,
	Anton Blanchard, Paul Mackerras, Christoph Lameter,
	open list:LINUX FOR POWERPC...

On 20/03/15 01:54, Michael Ellerman wrote:
> On Thu, 2015-03-19 at 09:22 +0200, Alex Dowad wrote:
>> On 19/03/15 08:45, Michael Ellerman wrote:
>>> On Fri, 2015-13-03 at 18:14:46 UTC, Alex Dowad wrote:
>>>> 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()).
>>>    
>>> I don't understand the bit about consistency with do_fork() ?
>>>
>> This series of patches includes one patch which renames the arg for
>> do_fork(), and others which rename the same arg for each arch-specific
>> implementation of copy_thread(). So if all of them are accepted and
>> merged, then all will be consistent. If only some of the patches are
>> accepted, I will rewrite the commit message so it doesn't mention
>> "consistency".
> Ah OK, I only got patch 23, so I missed the context of the whole series.
>
> I'll apply this one to the powerpc tree.
>
Dear M. Ellerman, sorry for not replying promptly. If you would like to 
apply this directly to the powerpc tree, that is fine, but can I edit 
the commit message to remove the mention of 'consistency'? I doubt that 
all 30+ archs will ever merge this change. Thanks, Alex

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [23/32] powerpc: copy_thread(): rename 'arg' argument to 'kthread_arg'
  2015-03-24 19:49           ` Alex Dowad
@ 2015-03-25  1:35             ` Michael Ellerman
  -1 siblings, 0 replies; 56+ messages in thread
From: Michael Ellerman @ 2015-03-25  1:35 UTC (permalink / raw)
  To: Alex Dowad
  Cc: linux-kernel, Michael Neuling, Paul Gortmaker, Paul Mackerras,
	Anton Blanchard, Vineeth Vijayan, Christoph Lameter,
	open list:LINUX FOR POWERPC...

On Tue, 2015-03-24 at 21:49 +0200, Alex Dowad wrote:
> On 20/03/15 01:54, Michael Ellerman wrote:
> > On Thu, 2015-03-19 at 09:22 +0200, Alex Dowad wrote:
> >> On 19/03/15 08:45, Michael Ellerman wrote:
> >>> On Fri, 2015-13-03 at 18:14:46 UTC, Alex Dowad wrote:
> >>>> 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()).
> >>>    
> >>> I don't understand the bit about consistency with do_fork() ?
> >>>
> >> This series of patches includes one patch which renames the arg for
> >> do_fork(), and others which rename the same arg for each arch-specific
> >> implementation of copy_thread(). So if all of them are accepted and
> >> merged, then all will be consistent. If only some of the patches are
> >> accepted, I will rewrite the commit message so it doesn't mention
> >> "consistency".
> > Ah OK, I only got patch 23, so I missed the context of the whole series.
> >
> > I'll apply this one to the powerpc tree.
>
> Dear M. Ellerman, sorry for not replying promptly. If you would like to 
> apply this directly to the powerpc tree, that is fine, but can I edit 
> the commit message to remove the mention of 'consistency'? I doubt that 
> all 30+ archs will ever merge this change. Thanks, Alex
 
I merged it last week:

  https://git.kernel.org/cgit/linux/kernel/git/mpe/linux.git/commit/?h=next&id=6eca8933d3ff17bff39d5f10a2a22366d8622fa6

And I edited the commit message more or less as you describe.

And feel free to call me Michael or mpe :)

cheers



^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [23/32] powerpc: copy_thread(): rename 'arg' argument to 'kthread_arg'
@ 2015-03-25  1:35             ` Michael Ellerman
  0 siblings, 0 replies; 56+ messages in thread
From: Michael Ellerman @ 2015-03-25  1:35 UTC (permalink / raw)
  To: Alex Dowad
  Cc: Michael Neuling, linux-kernel, Paul Gortmaker, Vineeth Vijayan,
	Anton Blanchard, Paul Mackerras, Christoph Lameter,
	open list:LINUX FOR POWERPC...

On Tue, 2015-03-24 at 21:49 +0200, Alex Dowad wrote:
> On 20/03/15 01:54, Michael Ellerman wrote:
> > On Thu, 2015-03-19 at 09:22 +0200, Alex Dowad wrote:
> >> On 19/03/15 08:45, Michael Ellerman wrote:
> >>> On Fri, 2015-13-03 at 18:14:46 UTC, Alex Dowad wrote:
> >>>> 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()).
> >>>    
> >>> I don't understand the bit about consistency with do_fork() ?
> >>>
> >> This series of patches includes one patch which renames the arg for
> >> do_fork(), and others which rename the same arg for each arch-specific
> >> implementation of copy_thread(). So if all of them are accepted and
> >> merged, then all will be consistent. If only some of the patches are
> >> accepted, I will rewrite the commit message so it doesn't mention
> >> "consistency".
> > Ah OK, I only got patch 23, so I missed the context of the whole series.
> >
> > I'll apply this one to the powerpc tree.
>
> Dear M. Ellerman, sorry for not replying promptly. If you would like to 
> apply this directly to the powerpc tree, that is fine, but can I edit 
> the commit message to remove the mention of 'consistency'? I doubt that 
> all 30+ archs will ever merge this change. Thanks, Alex
 
I merged it last week:

  https://git.kernel.org/cgit/linux/kernel/git/mpe/linux.git/commit/?h=next&id=6eca8933d3ff17bff39d5f10a2a22366d8622fa6

And I edited the commit message more or less as you describe.

And feel free to call me Michael or mpe :)

cheers

^ permalink raw reply	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2015-03-25  1:35 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-13 18:14 [PATCH 11/32] frv: copy_thread(): rename 'arg' argument to 'kthread_arg' Alex Dowad
2015-03-13 18:14 ` [PATCH 12/32] hexagon: " Alex Dowad
2015-03-13 18:14   ` Alex Dowad
2015-03-16 16:25   ` rkuo
2015-03-13 18:14 ` [PATCH 13/32] ia64: copy_thread(): rename 'user_stack_size' " Alex Dowad
2015-03-13 18:14   ` Alex Dowad
2015-03-14 17:54   ` Alex Dowad
2015-03-14 17:54     ` Alex Dowad
2015-03-13 18:14 ` [PATCH 14/32] m32r: copy_thread(): rename 'arg' " Alex Dowad
2015-03-13 18:14 ` [PATCH 15/32] m68k: " Alex Dowad
2015-03-13 18:14 ` Alex Dowad
2015-03-13 18:14 ` [PATCH 16/32] metag: " Alex Dowad
2015-03-13 18:14   ` Alex Dowad
2015-03-16 11:39   ` James Hogan
2015-03-16 11:39     ` James Hogan
2015-03-16 13:13     ` [PATCHv2 " Alex Dowad
2015-03-16 14:31       ` James Hogan
2015-03-16 14:31         ` James Hogan
2015-03-16 14:38         ` Alex Dowad
2015-03-16 14:38         ` [PATCHv3 " Alex Dowad
2015-03-16 14:52           ` James Hogan
2015-03-16 14:52             ` James Hogan
2015-03-13 18:14 ` [PATCH 17/32] microblaze: " Alex Dowad
2015-03-13 18:14 ` [PATCH 18/32] mips: " Alex Dowad
2015-03-13 18:14   ` Alex Dowad
2015-03-13 18:14 ` [PATCH 19/32] mn10300: copy_thread(): rename 'ustk_size' " Alex Dowad
2015-03-13 18:14 ` [PATCH 20/32] nios2: copy_thread(): rename 'arg' " Alex Dowad
2015-03-13 18:14 ` [PATCH 21/32] openrisc: " Alex Dowad
2015-03-13 18:14 ` [PATCH 22/32] parisc: " Alex Dowad
2015-03-13 18:14 ` [PATCH 23/32] powerpc: " Alex Dowad
2015-03-13 18:14   ` Alex Dowad
2015-03-19  6:45   ` [23/32] " Michael Ellerman
2015-03-19  6:45     ` Michael Ellerman
2015-03-19  7:22     ` Alex Dowad
2015-03-19  7:22       ` Alex Dowad
2015-03-19 23:54       ` Michael Ellerman
2015-03-19 23:54         ` Michael Ellerman
2015-03-24 19:49         ` Alex Dowad
2015-03-24 19:49           ` Alex Dowad
2015-03-25  1:35           ` Michael Ellerman
2015-03-25  1:35             ` Michael Ellerman
2015-03-13 18:14 ` [PATCH 24/32] s390: " Alex Dowad
2015-03-13 18:14   ` Alex Dowad
2015-03-13 18:14 ` [PATCH 25/32] score: " Alex Dowad
2015-03-13 18:14 ` [PATCH 26/32] sh: " Alex Dowad
2015-03-13 18:14   ` Alex Dowad
2015-03-13 18:14 ` [PATCH 27/32] sparc: " Alex Dowad
2015-03-13 18:14   ` Alex Dowad
2015-03-13 18:14 ` [PATCH 28/32] tile: " Alex Dowad
2015-03-16 20:19   ` Chris Metcalf
2015-03-16 20:44     ` Alex Dowad
2015-03-19 18:06       ` Chris Metcalf
2015-03-13 18:14 ` [PATCH 29/32] um: " Alex Dowad
2015-03-13 18:14 ` [PATCH 30/32] unicore32: copy_thread(): rename 'stk_sz' " Alex Dowad
2015-03-13 18:14 ` [PATCH 31/32] x86: copy_thread(): rename 'arg' " Alex Dowad
2015-03-13 18:14 ` [PATCH 32/32] xtensa: " Alex Dowad

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.