From patchwork Fri Mar 13 18:14:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Dowad X-Patchwork-Id: 6008471 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BE2E99F318 for ; Fri, 13 Mar 2015 18:17:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D316B20256 for ; Fri, 13 Mar 2015 18:17:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E98FA2020F for ; Fri, 13 Mar 2015 18:17:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756358AbbCMSRB (ORCPT ); Fri, 13 Mar 2015 14:17:01 -0400 Received: from mail-wg0-f43.google.com ([74.125.82.43]:39765 "EHLO mail-wg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932307AbbCMSQR (ORCPT ); Fri, 13 Mar 2015 14:16:17 -0400 Received: by wghn12 with SMTP id n12so25030160wgh.6; Fri, 13 Mar 2015 11:16:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UDRZ69W8m+ENuqO+9U7oGNL9YYoVr/C91ac9F6C35QE=; b=y8lNwDG3gMFQDTM+0HArf/xPcx8IZOjyDaAKqUAV5RdTtiPElpnZlkCxSZxQbo2SAP A6N6/n0ICIDgHpPBQ0q4C6g5uG4OJfgoTOvWiJyyUsHzyz849jnPiMU3UCJ32C3OWOhz LcEDZ57yN4xgSc51QZ1ClyGQrS117baAjH+7PnL9hlMCe+sn1Vx91UQ7cw2HTlxZsVqp OOK7GZ0aQZ2fZvDsryc4inSslT3HSHpecUrs2zFqLxJodXxJ2KJQ/vI5h1cJO+xb+X8Z ZC8Q4w/s7kBjR9/RnUsgoE8FagjjlPKbKQd5/qEhXSFTXCSkP6uUMu0xFwFLPmPcch6P SLMA== X-Received: by 10.194.92.169 with SMTP id cn9mr20699634wjb.61.1426270575822; Fri, 13 Mar 2015 11:16:15 -0700 (PDT) Received: from alex-ThinkPad-L530.resnet.local ([41.215.180.30]) by mx.google.com with ESMTPSA id gj16sm3789705wic.24.2015.03.13.11.16.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Mar 2015 11:16:15 -0700 (PDT) From: Alex Dowad To: linux-kernel@vger.kernel.org Cc: linux-sh@vger.kernel.org (open list:SUPERH) Subject: [PATCH 26/32] sh: copy_thread(): rename 'arg' argument to 'kthread_arg' Date: Fri, 13 Mar 2015 20:14:49 +0200 Message-Id: <1426270496-26362-16-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-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- arch/sh/kernel/process_32.c | 10 ++++++++-- arch/sh/kernel/process_64.c | 12 +++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c index 2885fc9..fded1b4 100644 --- a/arch/sh/kernel/process_32.c +++ b/arch/sh/kernel/process_32.c @@ -123,8 +123,11 @@ EXPORT_SYMBOL(dump_fpu); asmlinkage void ret_from_fork(void); asmlinkage void ret_from_kernel_thread(void); +/* + * Copy architecture-specific thread state + */ int copy_thread(unsigned long clone_flags, unsigned long usp, - unsigned long arg, struct task_struct *p) + unsigned long kthread_arg, struct task_struct *p) { struct thread_info *ti = task_thread_info(p); struct pt_regs *childregs; @@ -146,9 +149,10 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, childregs = task_pt_regs(p); p->thread.sp = (unsigned long) childregs; if (unlikely(p->flags & PF_KTHREAD)) { + /* kernel thread */ memset(childregs, 0, sizeof(struct pt_regs)); p->thread.pc = (unsigned long) ret_from_kernel_thread; - childregs->regs[4] = arg; + childregs->regs[4] = kthread_arg; childregs->regs[5] = usp; childregs->sr = SR_MD; #if defined(CONFIG_SH_FPU) @@ -159,6 +163,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, p->thread.fpu_counter = 0; return 0; } + + /* user thread */ *childregs = *current_pt_regs(); if (usp) diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c index e2062e6..693105d 100644 --- a/arch/sh/kernel/process_64.c +++ b/arch/sh/kernel/process_64.c @@ -371,8 +371,11 @@ EXPORT_SYMBOL(dump_fpu); asmlinkage void ret_from_fork(void); asmlinkage void ret_from_kernel_thread(void); +/* + * Copy architecture-specific thread state + */ int copy_thread(unsigned long clone_flags, unsigned long usp, - unsigned long arg, struct task_struct *p) + unsigned long kthread_arg, struct task_struct *p) { struct pt_regs *childregs; @@ -391,14 +394,17 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, p->thread.sp = (unsigned long) childregs; if (unlikely(p->flags & PF_KTHREAD)) { + /* kernel thread */ memset(childregs, 0, sizeof(struct pt_regs)); - childregs->regs[2] = (unsigned long)arg; - childregs->regs[3] = (unsigned long)usp; + childregs->regs[2] = kthread_arg; + childregs->regs[3] = usp; childregs->sr = (1 << 30); /* not user_mode */ childregs->sr |= SR_FD; /* Invalidate FPU flag */ p->thread.pc = (unsigned long) ret_from_kernel_thread; return 0; } + + /* user thread */ *childregs = *current_pt_regs(); /*