Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3483116imm; Tue, 29 May 2018 08:01:49 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo25SRUHp5E/wnFekJXkGpWQFVIXg5czothu6lkflzuVvACu1Ja8ZifufZNg9i3l0qiNGwd X-Received: by 2002:a63:798d:: with SMTP id u135-v6mr13741241pgc.401.1527606109771; Tue, 29 May 2018 08:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527606109; cv=none; d=google.com; s=arc-20160816; b=W8fx7AREgL0MwVWA7HNjnUOPPq5zN6VDGofkVL7NMBrvePXU5j5ykZs/QPCX2MaAhS 0iQYzGW7GPPYLfNHz8HAvhBgRKCb3l2w+U4rY3wGQS49VTlV30IsUvhgaaI4UpE572hq LU0uPZ6l7Qyo9hkUgM3A2vdlBjwxZqOBMmIbt6nzHmuJcFJ2SqjQI57GM81WC8AsYhyK k1rTnheOydG4Y2LTUVw672mtW/AEbq1zmIOcR9xyCRCkTYHluXzRV6e/0tLdkrOTUUh4 959+ncV9sJWDGE4AntDi9jl9Qj3tjUlvz6g2sTK+Ohe1S6E6tjdCGAitCHkg1rbwVfuD OWWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:mime-version:user-agent :message-id:in-reply-to:date:references:cc:to:from :arc-authentication-results; bh=fJh1myEKG/9xK7Ued5NtrhG2U2nXTIeBLnTol8ZCygg=; b=HnnqoWkYc8IbfoaVpowjFCEJKp5wxiccTdPKABoQasX1FDN9lwS+QEbeUFkE0vsYya SrWQFWuqG7uhqAppldAdrNXCNn4Fq6IQd137QdRUwSRr610KXCkjKwX4U/aPXmOU35/j PXpB/4vFxF4RHwf8uG00qU0Jmt8WwwyXVO3TqCeE+qobZzI7MNz551ieMfioovlmajkI 2mVomwgblvNI/OvI4M9SXw/A5shEZx4DMxe7OsU6uoAbLbsP5H014XoCEnEBZ1BzHL4w FLpKgV7aAPb9gdsPfsJnErHMfNR/m7LgfY1ub4FCGZjlq/dMn3fGGnEp/U5nBlHk/cdd ygXg== 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 f10-v6si6820667pgs.655.2018.05.29.08.01.35; Tue, 29 May 2018 08:01:49 -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 S936536AbeE2PBG (ORCPT + 99 others); Tue, 29 May 2018 11:01:06 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:57534 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935244AbeE2PBA (ORCPT ); Tue, 29 May 2018 11:01:00 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fNg7N-0004DH-O6; Tue, 29 May 2018 09:00:57 -0600 Received: from [97.119.174.25] (helo=x220.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fNg7M-0005BO-4e; Tue, 29 May 2018 09:00:57 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Geert Uytterhoeven Cc: Rich Felker , Linux-Arch , Linux Kernel Mailing List , Yoshinori Sato , Linux-sh list References: <87604mhrnb.fsf@xmission.com> <20180420143811.9994-16-ebiederm@xmission.com> <20180420145514.GP3094@brightrain.aerifal.cx> Date: Tue, 29 May 2018 10:00:42 -0500 In-Reply-To: (Geert Uytterhoeven's message of "Mon, 28 May 2018 11:19:55 +0200") Message-ID: <87h8mqo6at.fsf_-_@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1fNg7M-0005BO-4e;;;mid=<87h8mqo6at.fsf_-_@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.119.174.25;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+IzCyZ7sfx9HjChTQEsrHLohqqvtTCE7s= 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 sa06.xmission.com X-Spam-Level: X-Spam-Status: No, score=0.5 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TooManySym_01,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 * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4934] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Geert Uytterhoeven X-Spam-Relay-Country: X-Spam-Timing: total 1062 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 2.8 (0.3%), b_tie_ro: 1.97 (0.2%), parse: 1.15 (0.1%), extract_message_metadata: 19 (1.8%), get_uri_detail_list: 1.73 (0.2%), tests_pri_-1000: 10 (1.0%), tests_pri_-950: 1.71 (0.2%), tests_pri_-900: 1.45 (0.1%), tests_pri_-400: 24 (2.3%), check_bayes: 22 (2.1%), b_tokenize: 10 (0.9%), b_tok_get_all: 6 (0.5%), b_comp_prob: 2.8 (0.3%), b_tok_touch_all: 2.2 (0.2%), b_finish: 0.63 (0.1%), tests_pri_0: 177 (16.7%), check_dkim_signature: 0.71 (0.1%), check_dkim_adsp: 3.2 (0.3%), tests_pri_500: 820 (77.3%), poll_dns_idle: 816 (76.8%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH] signal/sh: Stop gcc warning about an impossible case in do_divide_error 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 in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Geert Uytterhoeven reported: > HOSTLD scripts/mod/modpost > CC arch/sh/kernel/traps_32.o > arch/sh/kernel/traps_32.c: In function 'do_divide_error': > arch/sh/kernel/traps_32.c:606:17: error: 'code' may be used uninitialized in this function [-Werror=uninitialized] > cc1: all warnings being treated as errors It is clear from inspection that do_divide_error is only called with TRAP_DIVZERO_ERROR or TRAP_DIVOVF_ERROR, as that is the way set_exception_table_vec is called. So let gcc know the other cases should not be considered by returning in all other cases. This removes the warning and let's the code continue to build. Reported-by: Geert Uytterhoeven Fixes: c65626c0cd4d ("signal/sh: Use force_sig_fault where appropriate") Signed-off-by: "Eric W. Biederman" --- I am adding this fix to my tree to at least let the code build. arch/sh/kernel/traps_32.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c index 660a4bc17698..60709ad17fc7 100644 --- a/arch/sh/kernel/traps_32.c +++ b/arch/sh/kernel/traps_32.c @@ -602,6 +602,9 @@ asmlinkage void do_divide_error(unsigned long r4) case TRAP_DIVOVF_ERROR: code = FPE_INTOVF; break; + default: + /* Let gcc know unhandled cases don't make it past here */ + return; } force_sig_fault(SIGFPE, code, NULL, current); } -- 2.14.1