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: 9417547 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 D0CFE6022E for ; Tue, 8 Nov 2016 14:06:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C25A828900 for ; Tue, 8 Nov 2016 14:06:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B708E2890F; Tue, 8 Nov 2016 14:06:06 +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=unavailable 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 62E5528900 for ; Tue, 8 Nov 2016 14:06:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E2CC16E07E; Tue, 8 Nov 2016 14:06:04 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org X-Greylist: delayed 435 seconds by postgrey-1.35 at gabe; Tue, 08 Nov 2016 14:06:03 UTC Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) by gabe.freedesktop.org (Postfix) with ESMTPS id 77D996E07E for ; Tue, 8 Nov 2016 14:06:03 +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 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:wFQXv0owAGo=:iHo/YYq8+kkIDc3oCd1X7S CHGuuSyrW4I+WMbjgV+/jfAceaazuRwpEWuEdQ0mnkhEIkdSvjNAlgmII8ssy86QbVnZPyO0t pIs/Ko+X2YFNFbFvgGBoss/LAPU9gi3j+w0+eo8ICGhsG9ey5KtZRKJIJc+oQd1wQo/ycZQoN zZA8XpzShCIJ6pF9P524tyeTeYi+AovaT5l5g/wZBxWcdKwdweklb0UPkIvjHGi+5jUqB1sSA sUzuza/ZibjEoqYzKxu+KPj9kXgzaj/99PgxMzpUTKnuraMvqFpaD0ugx+2jM5CbzDJOUP4NA PTRIsqXcoqJB2DH21iS4RHIxllP0TkZjC4AnvSxy4T9ABKD3+D4PCsprCBGH/eEZV3rj8uYig vx+io/ZXqnfWADuaAQKwY7coEGzZL5RQkiFzE3pkOyQ5/Brg3viTN28Djm5eFSi2zvdRdGlrh ivPbOw3yJDrBWDrJlg0HntEtV8boSwL9s0XFOcnGni9RavlTiE8jQV62VKQTYzpMETTE1bX47 g+2k9ACI/iijiY3E9dmRAGUKGXmZWHeYQhBJdQ1+E/JjhDGYuh+jNJZ9sEe0T4IdzTzvIfA8x +Hr00hTejW+/doSXC3Yxv+lYe+OAEmHHI9ANMn7b2zPx46C52hQajK2kERD7RKE0YE7ibglkE jkx26qT9N6QrefdM7KHleX/UawcpM+fnJ0m4Tg3jaWUmmL/MZT+wPDc27SXHc5O8PHpVRHxUQ 9RAz5omquUIBePC9 Cc: Arnd Bergmann , David Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH] drm/i915: avoid harmless empty-body warning X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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