Received: by 10.192.165.148 with SMTP id m20csp345902imm; Fri, 20 Apr 2018 07:43:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx49P/dLigjlliIuTDRLTzomglGp0vwULaWwiiEIi2xYiHW0o8uqLJEQC1o9m9JAvmCx/Cq6W X-Received: by 10.101.82.11 with SMTP id o11mr8880310pgp.131.1524235411089; Fri, 20 Apr 2018 07:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524235411; cv=none; d=google.com; s=arc-20160816; b=QWORCTjVMdzRF4BkKEU44KoMiORS8VosM1MIIr4Gg0pm+d/k8yMxDFgMF7v9pnbmWc oErLz0gf/mDnFaw3gu9HFx4Y+4LRo6zbhmavARI1YMJVnBFnrAoTrXTGHdj9DgSSXhOr NJdNoIAiMVxuiKpJSQA1fSDl4aP7CH+BvNFMKui1HxodRJ0omRDU9brKxErkRGt8cX4l gPqml1yraD8M4RmyIgLC4BWqra+LxxJhF3FBuRbiECqJcyp60e6/uBnM1gyoLq5hcWLX kTrg4CdDSCjDjKMX4hGd+TwqFm4yXGYHEyfn1r9lAbLhfQ5J3LHrna+UT+MiLpq+trzx bYhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=XsNspBxw5eLPumlRGB42TLprqvbydxwu3FRGSg7Z2e4=; b=iUwRkN17+9vEhrzhxn8aZQn9g+uTW/0wn5obTCuV+8GXVQyLbKRA65kBiGETcoGJZB gDhqyskcrRhUXUvGOTHtGvEePXaFs4pBAJzqIUCp7uaGViqXEvWGQXSqaIbPlWesY0Ht 2B2AMavlSReaUx183I4qJJNYOxxm0bq5rSYOCM8jOSX0bRH3O/Wmeu98/WTxPqubD5Cl MDaFRjw/I1ZyRSgRQaxteQtl0fVXYdLX2wBJhz6+Lvbhj0J9y7tUpOOKatMX2lpCWM3Q kzDisdbQhFfatNSNRVIFQpBwBKNdEIlncp3PczW67dbSHH5WARUG/F+qq4x3CFENio1y XzUg== 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 b4si4944226pgu.79.2018.04.20.07.43.16; Fri, 20 Apr 2018 07:43:31 -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 S1755398AbeDTOkl (ORCPT + 99 others); Fri, 20 Apr 2018 10:40:41 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:44224 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755165AbeDTOkh (ORCPT ); Fri, 20 Apr 2018 10:40:37 -0400 Received: from in02.mta.xmission.com ([166.70.13.52]) by out02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1f9XDI-0007VU-HI; Fri, 20 Apr 2018 08:40:36 -0600 Received: from [97.119.174.25] (helo=x220.int.ebiederm.org) by in02.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1f9XD3-0006Ha-3u; Fri, 20 Apr 2018 08:40:36 -0600 From: "Eric W. Biederman" To: linux-arch@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Eric W. Biederman" , Mark Salter , Aurelien Jacquiot , linux-c6x-dev@linux-c6x.org Date: Fri, 20 Apr 2018 09:37:52 -0500 Message-Id: <20180420143811.9994-3-ebiederm@xmission.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <87604mhrnb.fsf@xmission.com> References: <87604mhrnb.fsf@xmission.com> X-XM-SPF: eid=1f9XD3-0006Ha-3u;;;mid=<20180420143811.9994-3-ebiederm@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=97.119.174.25;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/NlapnllvD6eFaAY9a2h9zvzZedSmBsyY= X-SA-Exim-Connect-IP: 97.119.174.25 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa07.xmission.com X-Spam-Level: *** X-Spam-Status: No, score=3.6 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,TR_Symld_Words,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01, XMNoVowels,XMSolicitRefs_0,XMSubLong autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * 1.5 TR_Symld_Words too many words that have symbols inside * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.1 XMSolicitRefs_0 Weightloss drug X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ***;linux-arch@vger.kernel.org X-Spam-Relay-Country: X-Spam-Timing: total 15021 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 2.3 (0.0%), b_tie_ro: 1.60 (0.0%), parse: 0.63 (0.0%), extract_message_metadata: 11 (0.1%), get_uri_detail_list: 1.30 (0.0%), tests_pri_-1000: 2.5 (0.0%), tests_pri_-950: 1.12 (0.0%), tests_pri_-900: 0.90 (0.0%), tests_pri_-400: 17 (0.1%), check_bayes: 16 (0.1%), b_tokenize: 5 (0.0%), b_tok_get_all: 6 (0.0%), b_comp_prob: 1.53 (0.0%), b_tok_touch_all: 2.5 (0.0%), b_finish: 0.52 (0.0%), tests_pri_0: 127 (0.8%), check_dkim_signature: 0.41 (0.0%), check_dkim_adsp: 2.6 (0.0%), tests_pri_500: 14856 (98.9%), poll_dns_idle: 14848 (98.8%), rewrite_mail: 0.00 (0.0%) Subject: [REVIEW][PATCH 03/22] signal/c6x: Use force_sig_fault where appropriate X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Filling in struct siginfo before calling force_sig_info a tedious and error prone process, where once in a great while the wrong fields are filled out, and siginfo has been inconsistently cleared. Simplify this process by using the helper force_sig_fault. Which takes as a parameters all of the information it needs, ensures all of the fiddly bits of filling in struct siginfo are done properly and then calls force_sig_info. In short about a 5 line reduction in code for every time force_sig_info is called, which makes the calling function clearer. Cc: Mark Salter Cc: Aurelien Jacquiot Cc: linux-c6x-dev@linux-c6x.org Signed-off-by: "Eric W. Biederman" --- arch/c6x/kernel/traps.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/c6x/kernel/traps.c b/arch/c6x/kernel/traps.c index c5feee4542b0..5c60aea3b75a 100644 --- a/arch/c6x/kernel/traps.c +++ b/arch/c6x/kernel/traps.c @@ -244,9 +244,7 @@ static struct exception_info eexcept_table[128] = { static void do_trap(struct exception_info *except_info, struct pt_regs *regs) { unsigned long addr = instruction_pointer(regs); - siginfo_t info; - clear_siginfo(&info); if (except_info->code != TRAP_BRKPT) pr_err("TRAP: %s PC[0x%lx] signo[%d] code[%d]\n", except_info->kernel_str, regs->pc, @@ -254,12 +252,8 @@ static void do_trap(struct exception_info *except_info, struct pt_regs *regs) die_if_kernel(except_info->kernel_str, regs, addr); - info.si_signo = except_info->signo; - info.si_errno = 0; - info.si_code = except_info->code; - info.si_addr = (void __user *)addr; - - force_sig_info(except_info->signo, &info, current); + force_sig_fault(except_info->signo, except_info->code, + (void __user *)addr, current); } /* -- 2.14.1