From: Matthew Auld <matthew.auld@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH] drm/i915: make GEM_WARN_ON less terrible
Date: Mon, 19 Mar 2018 18:08:54 +0000 [thread overview]
Message-ID: <20180319180854.12771-1-matthew.auld@intel.com> (raw)
GEM_WARN_ON() was originally intended to be used only as:
if (GEM_WARN_ON(expr))
...
but it just so happens to also work as simply:
GEM_WARN_ON(expr);
since it just wraps WARN_ON, which is a little misleading since for
!DRM_I915_DEBUG_GEM builds the second case will actually break the
build. Given that there are some patches floating around which seem to
miss this, it probably makes sense to just make it work for both cases.
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
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 8922344fc21b..6a4375437b88 100644
--- a/drivers/gpu/drm/i915/i915_gem.h
+++ b/drivers/gpu/drm/i915/i915_gem.h
@@ -44,7 +44,7 @@
#else
#define GEM_BUG_ON(expr) BUILD_BUG_ON_INVALID(expr)
-#define GEM_WARN_ON(expr) (BUILD_BUG_ON_INVALID(expr), 0)
+#define GEM_WARN_ON(expr) ({BUILD_BUG_ON_INVALID(expr), 0;})
#define GEM_DEBUG_DECL(var)
#define GEM_DEBUG_EXEC(expr) do { } while (0)
--
2.14.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next reply other threads:[~2018-03-19 18:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-19 18:08 Matthew Auld [this message]
2018-03-19 18:17 ` [PATCH] drm/i915: make GEM_WARN_ON less terrible Chris Wilson
2018-03-19 19:23 ` Matthew Auld
2018-03-19 20:21 ` Jani Nikula
2018-04-04 9:13 ` Joonas Lahtinen
2018-04-04 10:05 ` Matthew Auld
2018-04-04 10:24 ` Joonas Lahtinen
2018-03-19 19:18 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-03-19 19:36 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-19 22:33 ` ✓ Fi.CI.IGT: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180319180854.12771-1-matthew.auld@intel.com \
--to=matthew.auld@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).