From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161229AbbCMSRV (ORCPT ); Fri, 13 Mar 2015 14:17:21 -0400 Received: from mail-we0-f182.google.com ([74.125.82.182]:37873 "EHLO mail-we0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161206AbbCMSRS (ORCPT ); Fri, 13 Mar 2015 14:17:18 -0400 From: Alex Dowad To: linux-kernel@vger.kernel.org Cc: Guan Xuetao , Chen Gang Subject: [PATCH 30/32] unicore32: copy_thread(): rename 'stk_sz' argument to 'kthread_arg' Date: Fri, 13 Mar 2015 20:14:53 +0200 Message-Id: <1426270496-26362-20-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 '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 --- 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