From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161248AbbCMSRn (ORCPT ); Fri, 13 Mar 2015 14:17:43 -0400 Received: from mail-we0-f178.google.com ([74.125.82.178]:42653 "EHLO mail-we0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756633AbbCMSR2 (ORCPT ); Fri, 13 Mar 2015 14:17:28 -0400 From: Alex Dowad To: linux-kernel@vger.kernel.org Cc: Chris Zankel , Max Filippov , 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 Message-Id: <1426270496-26362-22-git-send-email-alexinbeijing@gmail.com> X-Mailer: git-send-email 2.0.0.GIT In-Reply-To: <1426270496-26362-1-git-send-email-alexinbeijing@gmail.com> References: <1426270496-26362-1-git-send-email-alexinbeijing@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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