From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751207AbbCMSFJ (ORCPT ); Fri, 13 Mar 2015 14:05:09 -0400 Received: from mail-wg0-f47.google.com ([74.125.82.47]:41791 "EHLO mail-wg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751800AbbCMSFD (ORCPT ); Fri, 13 Mar 2015 14:05:03 -0400 From: Alex Dowad To: linux-kernel@vget.kernel.org Cc: Andrew Morton , Oleg Nesterov , Peter Zijlstra , "Kirill A. Shutemov" , Rik van Riel , Vladimir Davydov , Thomas Gleixner , David Rientjes , Kees Cook , Aaron Tomlin , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 01/32] do_fork(): Rename 'stack_size' argument to reflect actual use Date: Fri, 13 Mar 2015 20:04:16 +0200 Message-Id: <1426269888-25600-1-git-send-email-alexinbeijing@gmail.com> X-Mailer: git-send-email 2.0.0.GIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 'stack_size' argument is never used to pass a stack size. It's only used when forking a kernel thread, in which case it is an argument which should be passed to the 'main' function which the kernel thread executes. Hence, rename it to 'kthread_arg'. Signed-off-by: Alex Dowad --- Hi, The following patches in this series perform a similar cleanup for the arch-specific implementations of copy_thread(). Each patch has been sent to the maintainers for the relevant arch. Thanks, AD kernel/fork.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/kernel/fork.c b/kernel/fork.c index cf65139..5a40dfd 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1186,10 +1186,12 @@ init_task_pid(struct task_struct *task, enum pid_type type, struct pid *pid) * It copies the registers, and all the appropriate * parts of the process environment (as per the clone * flags). The actual kick-off is left to the caller. */ static struct task_struct *copy_process(unsigned long clone_flags, unsigned long stack_start, - unsigned long stack_size, + unsigned long kthread_arg, int __user *child_tidptr, struct pid *pid, int trace) @@ -1401,7 +1403,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, retval = copy_io(clone_flags, p); if (retval) goto bad_fork_cleanup_namespaces; - retval = copy_thread(clone_flags, stack_start, stack_size, p); + retval = copy_thread(clone_flags, stack_start, kthread_arg, p); if (retval) goto bad_fork_cleanup_io; @@ -1630,7 +1632,7 @@ struct task_struct *fork_idle(int cpu) */ long do_fork(unsigned long clone_flags, unsigned long stack_start, - unsigned long stack_size, + unsigned long kthread_arg, int __user *parent_tidptr, int __user *child_tidptr) { @@ -1656,7 +1658,7 @@ long do_fork(unsigned long clone_flags, trace = 0; } - p = copy_process(clone_flags, stack_start, stack_size, + p = copy_process(clone_flags, stack_start, kthread_arg, child_tidptr, NULL, trace); /* * Do this prior waking up the new thread - the thread pointer @@ -1740,7 +1742,7 @@ SYSCALL_DEFINE5(clone, unsigned long, newsp, unsigned long, clone_flags, int, tls_val) #elif defined(CONFIG_CLONE_BACKWARDS3) SYSCALL_DEFINE6(clone, unsigned long, clone_flags, unsigned long, newsp, - int, stack_size, + int, ignored, int __user *, parent_tidptr, int __user *, child_tidptr, int, tls_val) -- 2.0.0.GIT