Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753147AbcKHN7h (ORCPT ); Tue, 8 Nov 2016 08:59:37 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:55321 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752399AbcKHN7c (ORCPT ); Tue, 8 Nov 2016 08:59:32 -0500 From: Arnd Bergmann To: Daniel Vetter Cc: Arnd Bergmann , Jani Nikula , David Airlie , Joonas Lahtinen , Chris Wilson , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1085 Lines: 30 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 --- 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 -- 2.9.0