From patchwork Mon May 14 17:14:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 135750 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2052267lji; Mon, 14 May 2018 10:18:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrgFD+dr9C12jCDAZREmekN081BWfZVgaCNGJQUd5h8XT+nmnugwyqdHN0jejG8NyB50vMf X-Received: by 2002:a63:6945:: with SMTP id e66-v6mr9264905pgc.306.1526318281828; Mon, 14 May 2018 10:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526318281; cv=none; d=google.com; s=arc-20160816; b=ysJKRsfPY9q+J7ZSWRONBnQN1fy6OshWGSeb9um+ZrypPnz1LoMmj9I4evzLmbUN5u F5YErV8QxLRx8phSr/Im2hgnegS0zDE+mliPJUV61d52PLIrSLYQgxDobdUb3DPs3H99 C+Tn61fCF1017qcJC5+fqI7O+25LMZOkxmWGSMnWGM7GyAc565opZaI5zvNSWdQlnSvH 02KCLE5QIGVdzYqKNvBFGdTdMw8h0gNNislkTdwKwjm8uEOluzXHR/Gow8bb8jegvL+I ACNGsvC8MuHT1LdtIDINKZOvLZ4cTpy6aZ+O7z/x/z5UG29l0bMA1CzrmVF2pQ1ycOAC ysEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=PHngfP9eriLpTGm3sS12Vaa3vwsW2kPmRa6YFhSizqU=; b=vgJMItPxIQ4zhIQClkQhg8uszVoVOUPrpjNvDo+ybpBWMNc59CAh/VpsatP2oW4hpG 7s191gp7HmJezDPGI139hgwmeKeXGmokzNZ69MmApyhODwZUNWRTmkE4DvpTOMg6LtSj GEF1bRlKrQzhLNyVBAzC2DJlmxl5XfvHZlZixK0nNvlymbk94a+NSvLNk1dX2CC5cGg8 kaW4chIUAD+pwsbaNj2uWS5x3YU/Nnu5Ht2P6mZLuTnl6prwt0Z1htUnH+hPMKbeDan/ PCLfJf0bFo3ahCf4oUesWJalro9N6v2BK7Tv93K9r0IdlMiIqZu/4H3DcT9Fhe5ryHcK KoVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g130-v6si9690780pfc.366.2018.05.14.10.18.01; Mon, 14 May 2018 10:18:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754437AbeENRR5 (ORCPT + 29 others); Mon, 14 May 2018 13:17:57 -0400 Received: from foss.arm.com ([217.140.101.70]:46980 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752588AbeENRPb (ORCPT ); Mon, 14 May 2018 13:15:31 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1654516BA; Mon, 14 May 2018 10:15:31 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2BE1D3F59F; Mon, 14 May 2018 10:15:30 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Subject: [RFC PATCH 06/11] powerpc: Remove unused task argument from prctl functions Date: Mon, 14 May 2018 18:14:22 +0100 Message-Id: <1526318067-4964-7-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1526318067-4964-1-git-send-email-Dave.Martin@arm.com> References: <1526318067-4964-1-git-send-email-Dave.Martin@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some powerpc-specific prctl backends take a task argument that is redundant, since the only thing ever passed is "current". This patch gets rid of the redundant arguments. No functional change. Signed-off-by: Dave Martin Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman --- arch/powerpc/include/asm/processor.h | 16 ++++++++-------- arch/powerpc/kernel/process.c | 30 +++++++++++++++--------------- kernel/sys.c | 12 ++++++------ 3 files changed, 29 insertions(+), 29 deletions(-) -- 2.1.4 Acked-by: Michael Ellerman diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h index c4b36a4..313dec1 100644 --- a/arch/powerpc/include/asm/processor.h +++ b/arch/powerpc/include/asm/processor.h @@ -407,17 +407,17 @@ unsigned long get_wchan(struct task_struct *p); #define KSTK_ESP(tsk) ((tsk)->thread.regs? (tsk)->thread.regs->gpr[1]: 0) /* Get/set floating-point exception mode */ -#define GET_FPEXC_CTL(tsk, adr) get_fpexc_mode((tsk), (adr)) -#define SET_FPEXC_CTL(tsk, val) set_fpexc_mode((tsk), (val)) +#define GET_FPEXC_CTL(adr) get_fpexc_mode((adr)) +#define SET_FPEXC_CTL(val) set_fpexc_mode((val)) -extern int get_fpexc_mode(struct task_struct *tsk, unsigned long adr); -extern int set_fpexc_mode(struct task_struct *tsk, unsigned int val); +extern int get_fpexc_mode(unsigned long adr); +extern int set_fpexc_mode(unsigned int val); -#define GET_ENDIAN(tsk, adr) get_endian((tsk), (adr)) -#define SET_ENDIAN(tsk, val) set_endian((tsk), (val)) +#define GET_ENDIAN(adr) get_endian((adr)) +#define SET_ENDIAN(val) set_endian((val)) -extern int get_endian(struct task_struct *tsk, unsigned long adr); -extern int set_endian(struct task_struct *tsk, unsigned int val); +extern int get_endian(unsigned long adr); +extern int set_endian(unsigned int val); #define GET_UNALIGN_CTL(tsk, adr) get_unalign_ctl((tsk), (adr)) #define SET_UNALIGN_CTL(tsk, val) set_unalign_ctl((tsk), (val)) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 1237f13..0fcb2f5 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -1896,9 +1896,9 @@ EXPORT_SYMBOL(start_thread); #define PR_FP_ALL_EXCEPT (PR_FP_EXC_DIV | PR_FP_EXC_OVF | PR_FP_EXC_UND \ | PR_FP_EXC_RES | PR_FP_EXC_INV) -int set_fpexc_mode(struct task_struct *tsk, unsigned int val) +int set_fpexc_mode(unsigned int val) { - struct pt_regs *regs = tsk->thread.regs; + struct pt_regs *regs = current->thread.regs; /* This is a bit hairy. If we are an SPE enabled processor * (have embedded fp) we store the IEEE exception enable flags in @@ -1919,8 +1919,8 @@ int set_fpexc_mode(struct task_struct *tsk, unsigned int val) * anyway to restore the prctl settings from * the saved environment. */ - tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR); - tsk->thread.fpexc_mode = val & + current->thread.spefscr_last = mfspr(SPRN_SPEFSCR); + current->thread.fpexc_mode = val & (PR_FP_EXC_SW_ENABLE | PR_FP_ALL_EXCEPT); return 0; } else { @@ -1938,18 +1938,18 @@ int set_fpexc_mode(struct task_struct *tsk, unsigned int val) * them does not change anything */ if (val > PR_FP_EXC_PRECISE) return -EINVAL; - tsk->thread.fpexc_mode = __pack_fe01(val); + current->thread.fpexc_mode = __pack_fe01(val); if (regs != NULL && (regs->msr & MSR_FP) != 0) regs->msr = (regs->msr & ~(MSR_FE0|MSR_FE1)) - | tsk->thread.fpexc_mode; + | current->thread.fpexc_mode; return 0; } -int get_fpexc_mode(struct task_struct *tsk, unsigned long adr) +int get_fpexc_mode(unsigned long adr) { unsigned int val; - if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) + if (current->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) #ifdef CONFIG_SPE if (cpu_has_feature(CPU_FTR_SPE)) { /* @@ -1964,21 +1964,21 @@ int get_fpexc_mode(struct task_struct *tsk, unsigned long adr) * anyway to restore the prctl settings from * the saved environment. */ - tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR); - val = tsk->thread.fpexc_mode; + current->thread.spefscr_last = mfspr(SPRN_SPEFSCR); + val = current->thread.fpexc_mode; } else return -EINVAL; #else return -EINVAL; #endif else - val = __unpack_fe01(tsk->thread.fpexc_mode); + val = __unpack_fe01(current->thread.fpexc_mode); return put_user(val, (unsigned int __user *) adr); } -int set_endian(struct task_struct *tsk, unsigned int val) +int set_endian(unsigned int val) { - struct pt_regs *regs = tsk->thread.regs; + struct pt_regs *regs = current->thread.regs; if ((val == PR_ENDIAN_LITTLE && !cpu_has_feature(CPU_FTR_REAL_LE)) || (val == PR_ENDIAN_PPC_LITTLE && !cpu_has_feature(CPU_FTR_PPC_LE))) @@ -1997,9 +1997,9 @@ int set_endian(struct task_struct *tsk, unsigned int val) return 0; } -int get_endian(struct task_struct *tsk, unsigned long adr) +int get_endian(unsigned long adr) { - struct pt_regs *regs = tsk->thread.regs; + struct pt_regs *regs = current->thread.regs; unsigned int val; if (!cpu_has_feature(CPU_FTR_PPC_LE) && diff --git a/kernel/sys.c b/kernel/sys.c index 994b5711..44e1c47 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -90,10 +90,10 @@ # define GET_FPEXC_CTL(a, b) (-EINVAL) #endif #ifndef GET_ENDIAN -# define GET_ENDIAN(a, b) (-EINVAL) +# define GET_ENDIAN(b) (-EINVAL) #endif #ifndef SET_ENDIAN -# define SET_ENDIAN(a, b) (-EINVAL) +# define SET_ENDIAN(b) (-EINVAL) #endif /* @@ -2265,10 +2265,10 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, error = GET_FPEMU_CTL(me, arg2); break; case PR_SET_FPEXC: - error = SET_FPEXC_CTL(me, arg2); + error = SET_FPEXC_CTL(arg2); break; case PR_GET_FPEXC: - error = GET_FPEXC_CTL(me, arg2); + error = GET_FPEXC_CTL(arg2); break; case PR_GET_TIMING: error = PR_TIMING_STATISTICAL; @@ -2291,10 +2291,10 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, return -EFAULT; break; case PR_GET_ENDIAN: - error = GET_ENDIAN(me, arg2); + error = GET_ENDIAN(arg2); break; case PR_SET_ENDIAN: - error = SET_ENDIAN(me, arg2); + error = SET_ENDIAN(arg2); break; case PR_GET_SECCOMP: error = prctl_get_seccomp();