From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752205AbbCPHD7 (ORCPT ); Mon, 16 Mar 2015 03:03:59 -0400 Received: from cassarossa.samfundet.no ([193.35.52.29]:39883 "EHLO cassarossa.samfundet.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750822AbbCPHDy (ORCPT ); Mon, 16 Mar 2015 03:03:54 -0400 Date: Mon, 16 Mar 2015 08:03:50 +0100 From: Hans-Christian Egtvedt To: Alex Dowad Cc: linux-kernel@vget.kernel.org, Haavard Skinnemoen , open list Subject: Re: [PATCH 06/32] avr32: copy_thread(): rename 'arg' argument to 'kthread_arg' Message-ID: <20150316070350.GA19986@samfundet.no> References: <1426269888-25600-1-git-send-email-alexinbeijing@gmail.com> <1426269888-25600-6-git-send-email-alexinbeijing@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426269888-25600-6-git-send-email-alexinbeijing@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Around Fri 13 Mar 2015 20:04:21 +0200 or thereabout, 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 In general Acked-by: Hans-Christian Egtvedt > --- > arch/avr32/kernel/process.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c > index 42a53e74..a255bd3 100644 > --- a/arch/avr32/kernel/process.c > +++ b/arch/avr32/kernel/process.c > @@ -279,20 +279,25 @@ asmlinkage void ret_from_fork(void); > asmlinkage void ret_from_kernel_thread(void); > asmlinkage void syscall_return(void); > > +/* > + * Copy architecture-specific thread state > + */ > int copy_thread(unsigned long clone_flags, unsigned long usp, > - unsigned long arg, > + unsigned long kthread_arg, > struct task_struct *p) > { > struct pt_regs *childregs = task_pt_regs(p); > > if (unlikely(p->flags & PF_KTHREAD)) { > + /* kernel thread */ This is not needed, it is clearly stated on the line above. > memset(childregs, 0, sizeof(struct pt_regs)); > - p->thread.cpu_context.r0 = arg; > + p->thread.cpu_context.r0 = kthread_arg; > p->thread.cpu_context.r1 = usp; /* fn */ > p->thread.cpu_context.r2 = (unsigned long)syscall_return; > p->thread.cpu_context.pc = (unsigned long)ret_from_kernel_thread; > childregs->sr = MODE_SUPERVISOR; > } else { > + /* user thread */ Likewise, do not add obvious comments. > *childregs = *current_pt_regs(); > if (usp) > childregs->sp = usp; -- Hans-Christian Egtvedt