From patchwork Wed Nov 16 14:19:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9431691 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3CE1760471 for ; Wed, 16 Nov 2016 14:20:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A7D52807B for ; Wed, 16 Nov 2016 14:20:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BDC728682; Wed, 16 Nov 2016 14:20:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BB85B2807B for ; Wed, 16 Nov 2016 14:20:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9EC3A6E6C5; Wed, 16 Nov 2016 14:20:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 478BC6E6C5 for ; Wed, 16 Nov 2016 14:20:48 +0000 (UTC) Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MV4iD-1cH6EK0xpt-00YUZQ; Wed, 16 Nov 2016 15:20:41 +0100 From: Arnd Bergmann To: Thomas Hellstrom Subject: [PATCH] drm/vmwgfx: avoid gcc-7 parentheses warning Date: Wed, 16 Nov 2016 15:19:31 +0100 Message-Id: <20161116141949.2052696-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:XjGAmd7OxeUYZ676J1Yatlsa8OLlqBor2xgsI+iUYvcaJcTVtwI KKoc6Cn5KBxj6TkP8w2xSlRjU86rXMGRC9nUZWKAJ5385MIzVK90lbZTwpqCO4Tl0Vb6m+/ Ki/nGUwO1F7kbbukxSsJZnTD8mP2t46YwO0l4nvx1vbwhGqTTJDNt/EzXx9lUe7yiYFwuMv cVnuGnNO1zQvE5Bi44wnA== X-UI-Out-Filterresults: notjunk:1; V01:K0:zM/bHTpZOUU=:NvArX2tnynk552A2xv7TnB 5Pk44ZaIWatN7Kd2GIb+ivZvspvO3NU2jhaDVP/FLaSNsCACak+NJWKWxoqD8yjdcbBFsx0Zb hqanyqvcXhl9+XVj1FwDZ001TvDmJ3TJ5ebIGFN/ouKhW2bTFJP88uUJJi0LnDTCYNeemRV3t mmp1TgYzjRfdGWzP+om1JOkhgnkyeoqNhjb1gM4LSMGa+p/7xkiPDdwAn5Ub1jIT1Asm1WOAj raPiE1J60WZergdTskcchmMk6lFY5ygGVuwKC6P1WM11ChV8je9P07GjbQECF6/FnRKf69M6o 5e/Fblkb6wf1BnWaV3TbJHfak1dDEaRnkjpeVHLEVj5HwI9AYFTCSRvBwu5fFJY1M+DG0s/ux lMIEU9tgzQta4kaBUN1AUTi4w4giUKdgoOgNvSq3eSjIjcfPNNyXtNeUDrbFyojqbzzRRgJ7Q IonD0fwNpBTyfe6fKzdbPO6rB6JKZh6CW3etr43q2GSJ3WJmkN82+1q4FS4jVYsJpGz7G3OCV R9LgGbM1O773B6dq5YbWPKF++2t5b2wMaN0LUrb9asguhGJNH40nvZGZn1blrknjdysxUFJH6 tqkkNAtCvwcEPbG6nHoZ5heyeJtWgQw1m6AdtrxYj2kFjVFDkVnLYXl0zVRoIKcqLAyF7E0xL SR0W7ULUOzJBOMOusJbIOq/S0J1R15E3aeI25AeQLoRLaqJPRFSWcMdbyh39Sgsnjt3E= Cc: VMware Graphics , Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Brian Paul , Charmaine Lee X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP gcc-7 warns about slightly suspicious code in vmw_cmd_invalid: drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c: In function 'vmw_cmd_invalid': drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:522:23: error: the omitted middle operand in ?: will always be 'true', suggest explicit middle operand [-Werror=parentheses] The problem is that it is mixing boolean and integer values here. I assume that the code actually works correctly, so making it use a literal '1' instead of the implied 'true' makes it more readable and avoids the warning. The code has been in this file since the start, but it could make sense to backport this patch to stable to make it build cleanly with gcc-7. Fixes: fb1d9738ca05 ("drm/vmwgfx: Add DRM driver for VMware Virtual GPU") Signed-off-by: Arnd Bergmann Reviewed-by: Sinclair Yeh --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index c7b53d987f06..3f343e55972a 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c @@ -519,7 +519,7 @@ static int vmw_cmd_invalid(struct vmw_private *dev_priv, struct vmw_sw_context *sw_context, SVGA3dCmdHeader *header) { - return capable(CAP_SYS_ADMIN) ? : -EINVAL; + return capable(CAP_SYS_ADMIN) ? 1 : -EINVAL; } static int vmw_cmd_ok(struct vmw_private *dev_priv,