mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Dowad <alexinbeijing@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Chris Zankel <chris@zankel.net>,
	Max Filippov <jcmvbkbc@gmail.com>,
	linux-xtensa@linux-xtensa.org (open list:TENSILICA XTENSA...)
Subject: [PATCH 32/32] xtensa: copy_thread(): rename 'arg' argument to 'kthread_arg'
Date: Fri, 13 Mar 2015 20:14:55 +0200	[thread overview]
Message-ID: <1426270496-26362-22-git-send-email-alexinbeijing@gmail.com> (raw)
In-Reply-To: <1426270496-26362-1-git-send-email-alexinbeijing@gmail.com>

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


      parent reply	other threads:[~2015-03-13 18:17 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 18:14 [PATCH 11/32] frv: " Alex Dowad
2015-03-13 18:14 ` [PATCH 12/32] hexagon: " 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-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 ` [PATCH 16/32] metag: " Alex Dowad
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:38         ` Alex Dowad
2015-03-16 14:38         ` [PATCHv3 " Alex Dowad
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 ` [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-19  6:45   ` [23/32] " Michael Ellerman
2015-03-19  7:22     ` Alex Dowad
2015-03-19 23:54       ` Michael Ellerman
2015-03-24 19:49         ` Alex Dowad
2015-03-25  1:35           ` Michael Ellerman
2015-03-13 18:14 ` [PATCH 24/32] s390: " 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 ` [PATCH 27/32] sparc: " 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 ` Alex Dowad [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426270496-26362-22-git-send-email-alexinbeijing@gmail.com \
    --to=alexinbeijing@gmail.com \
    --cc=chris@zankel.net \
    --cc=jcmvbkbc@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xtensa@linux-xtensa.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®