[RFC 2/7] drm/i915/i915_utils: add dev_WARN_ON and dev_WARN_ON_ONCE macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It's quite useful to print the device name on the stack dump caused
by WARN_ON*.

Introduce dev_WARN_ON and dev_WARN_ON_ONCE macros for the same.

Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@xxxxxxxxx>
---
 drivers/gpu/drm/i915/i915_utils.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h
index b0ade76bec90..b4b4d326590c 100644
--- a/drivers/gpu/drm/i915/i915_utils.h
+++ b/drivers/gpu/drm/i915/i915_utils.h
@@ -52,6 +52,14 @@ struct timer_list;
 #define MISSING_CASE(x) WARN(1, "Missing case (%s == %ld)\n", \
 			     __stringify(x), (long)(x))
 
+#undef dev_WARN_ON
+#define dev_WARN_ON(dev, x) dev_WARN((dev), (x), "%s", \
+				     "WARN_ON(" __stringify(x) ")")
+
+#undef dev_WARN_ON_ONCE
+#define dev_WARN_ON_ONCE(dev, x) dev_WARN_ONCE((dev), (x), "%s", \
+					  "WARN_ON_ONCE(" __stringify(x) ")")
+
 void __printf(3, 4)
 __i915_printk(struct drm_i915_private *dev_priv, const char *level,
 	      const char *fmt, ...);
-- 
2.23.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux