Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2137840imm; Mon, 28 May 2018 02:21:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqQOzEfmTYLShr8ESMcmSd+LzfibXL8dNkOp+ORT4SWshKRHxv3Qs201g6yW7vQWantmQae X-Received: by 2002:a62:9056:: with SMTP id a83-v6mr12787640pfe.186.1527499316205; Mon, 28 May 2018 02:21:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527499316; cv=none; d=google.com; s=arc-20160816; b=Un3hMNK9I+QX+pkn7Od3zyh1C3ktt0ueeFKQSrr6hPOpzyLpaZhIvC5bDM2IQMraZI fSbzoXr9AEoxt0ZvoVQxbxrqS2s14p5HK+xL3dZc8vYl/CozAtVWLlDszFJHR2q4+85A /Khwdq4U+lcrHzmjfktfkOuIycswQhEN8c3CSvkzuSmnHOr7JBLTP/6oNurYFfswxosY txvAEjlvmF5LdwPtvkmuDSJcrxhYyJronSFWWROqX6m7EPQ3HC6vlHaZwtMqcR48Sm+0 HceNaf9XdNI8lD/7E9J6w+86aZWAuFqHW/ZozEzybYtLF2M3QtnlQuZuQrjVY2QBh6iG 553g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=qB3y1DSfeQ5ZP8E+zNFqFQhI7HLv4FzTIzRlorhy8DU=; b=FNzt4nk1KU4Xt67U0EKQi/tQ1xtPgVdjcrSnkrVFY0CtSs/TaTjyHGVYqesIyM/eXJ DZ+QsbpCrh+NtYLVa3ABfyIKhZ5vqCb8jyvPefjmsBWJWjD8PCk5Vtoj88HQttZFpi4M LGUcw8O924mSr/QqeQ7mOt6hglo0+IRcuAdhZ6l/naKdXLfyYAHRYb5bvudvuPlXYUxl BHUHjoQ1QuLxOjdOnor7J6goLVfxAAofv/tbXhWLyQnnE0UrzLTJ1peCnn0IXf+DavVC sBj5vz4eNIpaiEHgkGJrA9HkHzbyWVg1Mb3ozAfvrL+Zwcw2UZKrm3p1sTAjLduW+zwX g6Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=AcWcOhNw; 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 f4-v6si23261643pgs.16.2018.05.28.02.21.41; Mon, 28 May 2018 02:21:56 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=AcWcOhNw; 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 S1754222AbeE1JT6 (ORCPT + 99 others); Mon, 28 May 2018 05:19:58 -0400 Received: from mail-vk0-f67.google.com ([209.85.213.67]:45338 "EHLO mail-vk0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753984AbeE1JT4 (ORCPT ); Mon, 28 May 2018 05:19:56 -0400 Received: by mail-vk0-f67.google.com with SMTP id n134-v6so6673121vke.12; Mon, 28 May 2018 02:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=qB3y1DSfeQ5ZP8E+zNFqFQhI7HLv4FzTIzRlorhy8DU=; b=AcWcOhNwGYSkNpAzo3TtP2YzPMtRF0MQByiJzTT+r9iVE38BFSx8ttftkxDzYcV3Ek vxq6CZZpi39XKrpyIWoESWJhcK0C8OZRri9R/sRLaRVHRF4RqVgNpD7YYHZ6bPTvsMq7 EQQGMZsUcngfWI2aNzufl0AL+ZvmT8Az/8opLxjLBpKpnx8PnsXtGatD7i5R26zFUqst CF8z/9A0zuwf9muuHsH70cYvNwIjc5LkrnbL9pYml8Y5x4ZcobzMBniZS9WZtU3v13+C qpZFUYP3hwpHmfTwKFdsCAsztqXfMI8Sjf2Wiyr0ale0vK8bHPWM6adBrTLwgaEzlONS xQYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=qB3y1DSfeQ5ZP8E+zNFqFQhI7HLv4FzTIzRlorhy8DU=; b=ajA/Pm008Lm4Sg0NMhe/b4E1j4aFqKSPmZKczZ+3g5LVPL+L6LmEJ7Y2D+auL7ojnJ FT7NeF+PR90k+RR/2Jc7UEYIHsUlxc72DlkVPkaAf7V+qy2vgx2l+GlIibtQdDrlaLIm z7hiVr60OImyuctpoy5lL/jdHNmyimr0rPDeIXzgxKm9N+Zd1pPAJDjOfxvTN95LMqmi cr/TSxBnCcFZyxwK+L9g2Rrzz/qwHLMQC2Wh+1GFSWM/HIHMKV8CRVZMjRxRu6kDFl84 TtXPugmD2hHwWpmB2hoSPEM0OGjJcRdKls2wMLv2fryUbb+4yMZAfhb2gIezy9ZJHVsK azDQ== X-Gm-Message-State: ALKqPwd0TG2tinxzLqZqd3TqvTvj8sroNq+Cz/8ivJZScirW5qmmbnKA yUlex3iukXC7eS25fHUJ3CqJZdKPdMCs6H9kg+jUQ1uW X-Received: by 2002:a1f:644:: with SMTP id 65-v6mr631137vkg.159.1527499195523; Mon, 28 May 2018 02:19:55 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:7a0a:0:0:0:0:0 with HTTP; Mon, 28 May 2018 02:19:55 -0700 (PDT) In-Reply-To: <20180420145514.GP3094@brightrain.aerifal.cx> References: <87604mhrnb.fsf@xmission.com> <20180420143811.9994-16-ebiederm@xmission.com> <20180420145514.GP3094@brightrain.aerifal.cx> From: Geert Uytterhoeven Date: Mon, 28 May 2018 11:19:55 +0200 X-Google-Sender-Auth: zU6cjyyyw831x_2CPz2arPhDhJo Message-ID: Subject: Re: [REVIEW][PATCH 16/22] signal/sh: Use force_sig_fault where appropriate To: Rich Felker Cc: "Eric W. Biederman" , Linux-Arch , Linux Kernel Mailing List , Yoshinori Sato , Linux-sh list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 20, 2018 at 4:55 PM, Rich Felker wrote: > On Fri, Apr 20, 2018 at 09:38:05AM -0500, Eric W. Biederman wrote: >> 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: Yoshinori Sato >> Cc: Rich Felker >> Cc: linux-sh@vger.kernel.org >> Signed-off-by: "Eric W. Biederman" >> --- a/arch/sh/kernel/traps_32.c >> +++ b/arch/sh/kernel/traps_32.c >> @@ -599,20 +593,17 @@ int is_dsp_inst(struct pt_regs *regs) >> #ifdef CONFIG_CPU_SH2A >> asmlinkage void do_divide_error(unsigned long r4) >> { >> - siginfo_t info; >> + int code; >> >> - clear_siginfo(&info); >> switch (r4) { >> case TRAP_DIVZERO_ERROR: >> - info.si_code = FPE_INTDIV; >> + code = FPE_INTDIV; >> break; >> case TRAP_DIVOVF_ERROR: >> - info.si_code = FPE_INTOVF; >> + code = FPE_INTOVF; >> break; >> } >> - >> - info.si_signo = SIGFPE; >> - force_sig_info(info.si_signo, &info, current); >> + force_sig_fault(SIGFPE, code, NULL, current); /kisskb/src/arch/sh/kernel/traps_32.c:606:17: error: 'code' may be used uninitialized in this function [-Werror=uninitialized] http://kisskb.ellerman.id.au/kisskb/buildresult/13366052/ http://kisskb.ellerman.id.au/kisskb/buildresult/13366048/ http://kisskb.ellerman.id.au/kisskb/buildresult/13366072/ >> } > Acked-by: Rich Felker Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds