From patchwork Wed Jul 19 12:53:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108282 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp780091qge; Wed, 19 Jul 2017 05:55:27 -0700 (PDT) X-Received: by 10.98.202.214 with SMTP id y83mr3560pfk.2.1500468927344; Wed, 19 Jul 2017 05:55:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500468927; cv=none; d=google.com; s=arc-20160816; b=Vh7iCf4Aw6Za08BPWmUvpvMIPaKsHpJ58jdHc4Hbx+rwncMzE3e6/XfUKFqNGYJ1ij CR38qxwP9AEUjehHcqNNnHtUvQzRIsOP40vUTE+WbYINPNwRJUaGqLJXijcduIOn5SOE PrhVnpuyrgONznre61BBK1UVsJ4ev69yrZEc/K5PgWhVG0JreA0+CKzEECdLOGGn1SIV 6gooH4Yc/tTr38RaNbqyQyI7SGWc9SQPZ4z3fgVR+Pdy2IlDwnZydioihDGyadwyjSyt c0rYwIJ5q2gZvmsxgF3NO+lHQG4MdKLqQ+r86GvuRuv4EO+nMgaX+KCKRgd9ckHBBo6N aoVQ== 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=xBTLw3C5/BX6gv3yEL0qGNzTphhZcowFF3f5RJ5Chho=; b=Nb9m1rf5PCrSvxzKUPWc861IUFc7FGjwaIQHcMo86+3jmmudITSlHCloYKTzZW0TEL Hq1xhQdTf/zvjUJslGkE6YMzs+FCuMdvVtoY4gsi0ydjVLvY+BDM3pdKxlChfn1lE53g fnDC8um4h0fnwNeKxc9hQBq4VcJQ15eLYqiamT31JMBZ1Bzwh/0bwXwi45pXdyDNIVB6 IS1zixiFH5S+nCuCDDj011ACcmHYVgojAYp2enMIlCdvn68426L2gXQRgeu4hjZuDilg 98STYmZbOW62k1kC0c45tCCzEqoCt5zQ8jTA+UQFVjAceIGgMnfDMA9BrW1gojmLiOCt 7pjA== 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 e8si4270964pgf.411.2017.07.19.05.55.27; Wed, 19 Jul 2017 05:55:27 -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 S1753712AbdGSMzY (ORCPT + 25 others); Wed, 19 Jul 2017 08:55:24 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:54098 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753401AbdGSMzU (ORCPT ); Wed, 19 Jul 2017 08:55:20 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MMWH0-1dYLeb3If0-008HYg; Wed, 19 Jul 2017 14:54:15 +0200 From: Arnd Bergmann To: x86@kernel.org, Bill Metzenthen , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 3/8] x86: math-emu: avoid bogus -Wint-in-bool-context warning Date: Wed, 19 Jul 2017 14:53:01 +0200 Message-Id: <20170719125310.2487451-4-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170719125310.2487451-1-arnd@arndb.de> References: <20170719125310.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vQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc-7.1.1 produces this warning: arch/x86/math-emu/reg_add_sub.c: In function 'FPU_add': arch/x86/math-emu/reg_add_sub.c:80:48: error: ?: using integer constants in boolean context [-Werror=int-in-bool-context] This appears to be a bug in gcc-7.1.1, and I have reported it as PR81484. The compiler suggests that code written as if (a & b ? c : d) is usually incorrect and should have been if (a & (b ? c : d)) However, in this case, we correctly write if ((a & b) ? c : d) and should not get a warning for it. This adds a dirty workaround for the problem, adding a comparison with zero inside of the macro. The warning is currently disabled in the kernel, so we may decide not to apply the patch, and instead wait for future gcc releases to fix the problem. On the other hand, it seems to be the only instance of this particular problem. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81484 Signed-off-by: Arnd Bergmann --- Originally sent on July 14, this is the same patch again with an rewritten changelog. --- arch/x86/math-emu/fpu_emu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/arch/x86/math-emu/fpu_emu.h b/arch/x86/math-emu/fpu_emu.h index afbc4d805d66..c9c320dccca1 100644 --- a/arch/x86/math-emu/fpu_emu.h +++ b/arch/x86/math-emu/fpu_emu.h @@ -157,7 +157,7 @@ extern u_char const data_sizes_16[32]; #define signbyte(a) (((u_char *)(a))[9]) #define getsign(a) (signbyte(a) & 0x80) -#define setsign(a,b) { if (b) signbyte(a) |= 0x80; else signbyte(a) &= 0x7f; } +#define setsign(a,b) { if ((b) != 0) signbyte(a) |= 0x80; else signbyte(a) &= 0x7f; } #define copysign(a,b) { if (getsign(a)) signbyte(b) |= 0x80; \ else signbyte(b) &= 0x7f; } #define changesign(a) { signbyte(a) ^= 0x80; }