From patchwork Tue Nov 8 13:58:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9417533 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 175086022E for ; Tue, 8 Nov 2016 13:58:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09A42288A4 for ; Tue, 8 Nov 2016 13:58:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2D07288CA; Tue, 8 Nov 2016 13:58:49 +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=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM 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 7D0FF288A4 for ; Tue, 8 Nov 2016 13:58:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DACFA6E095; Tue, 8 Nov 2016 13:58:48 +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.126.133]) by gabe.freedesktop.org (Postfix) with ESMTPS id 056ED6E095 for ; Tue, 8 Nov 2016 13:58:47 +0000 (UTC) Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue005) with ESMTPA (Nemesis) id 0M21V9-1cxAPe3dYB-00tyLK; Tue, 08 Nov 2016 14:58:38 +0100 From: Arnd Bergmann To: Daniel Vetter Subject: [PATCH] drm/i915: avoid harmless empty-body warning Date: Tue, 8 Nov 2016 14:58:17 +0100 Message-Id: <20161108135834.2166677-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 MIME-Version: 1.0 X-Provags-ID: V03:K0:tZLb+LP4FtqT/3I9NCfZdd5Jz9VdioTIGT+QIwefLC/CRAjQVnl 7qs25e5tOAiIypKCiCZ581D6nqYk9gpW5wqlf1TLRPRFNHinpWL0b0jtwMjUpINTqCS+ffm D5RfXfo5FiBegdzqdFGA4SGta+9fw5nTkUPnp8ZBUglcrPNP+gp2Z+e0om2KHw5TbNrorso BjDCmwtbP+9o/o89jFxRA== X-UI-Out-Filterresults: notjunk:1; V01:K0:mFXJMexMNY0=:TohebWgWkZiaqJrNX6+P+L T59DR/DA/CZU0dDoitF6yRxsHMYyaHS92mBPkA7MYpiHkCTuf25GR4wZkMZdddeOXVTEYw4/G MgUduN+RuB3gHpEbtGWE+UmfZweu2QE/paeBc7ynfdDL8Ld48eEr7vvCsm/fxQNCrt+JvKZc7 iQ1e4HYHqqSIqv/yQsFmgBY9ks59ZJJxZwWx9l2RA3JiTNqNgYg/qnQLVdt2Ywvgq2sLCq0Rs dBGSIK/oIBYVu8ppYw6SaR50SK+UpFYH8FgnOB9eyrlAWjd+6eMCcFvcNb3ewkufKTgrS6h5i NjHCWP5+FqKdMP5IxrxvAOlo/Ml65ptCkxnv4PlgtTEWJGsCNaM3urXsIQTehQUUjPr735L9z 1HV7YRXZm2h1xsgNormmipW8SN926a/H+iUxaPAXlLJ66qwlqHUCV1vc4msrb6boBCVp3hQh5 wgf3g1VzHgdsEw7kvSrwAqtkuo1KF0K65hOJ4MGpig0iEYgy4VM8oihGn2fmRdObrLw6wfZY5 lYMKdTgA3cpwbi+Q87zm6yRk06/NlxmEfeQPaGVQUGBzbRiVe3uovn8lslcX8uKFv2RVoG+2V J++xeQcA5yNyZN5bYQzCHIkImWTDN5w17Gs/MUeOnxjC62vgudv/p+icfVn9IIDe7oSMXK8GR mVlnungGK0JI6/rtqqPAJRQ0eiWB5oh0irGoKllc51eAc6bVtfJZlY2i9UmWKBd5D04NIXpBC WL3DqC9pjjdgLNou Cc: Arnd Bergmann , intel-gfx@lists.freedesktop.org, Joonas Lahtinen , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The newly added assert_kernel_context_is_current introduces a warning when built with W=1: drivers/gpu/drm/i915/i915_gem.c: In function ‘assert_kernel_context_is_current’: drivers/gpu/drm/i915/i915_gem.c:4417:63: error: suggest braces around empty body in an ‘else’ statement [-Werror=empty-body] Changing the GEM_BUG_ON() macro from an empty definition to "do { } while (0)" makes the macro more robust to use and avoids the warning. Fixes: 3033acab07f9 ("drm/i915: Queue the idling context switch after all other timelines") Signed-off-by: Arnd Bergmann Reviewed-by: Chris Wilson --- drivers/gpu/drm/i915/i915_gem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h index 735580d72eb1..51ec793f2e20 100644 --- a/drivers/gpu/drm/i915/i915_gem.h +++ b/drivers/gpu/drm/i915/i915_gem.h @@ -28,7 +28,7 @@ #ifdef CONFIG_DRM_I915_DEBUG_GEM #define GEM_BUG_ON(expr) BUG_ON(expr) #else -#define GEM_BUG_ON(expr) +#define GEM_BUG_ON(expr) do { } while (0) #endif #define I915_NUM_ENGINES 5