[PATCH v5 1/6] drm/xe: Add XE_MISSING_CASE macro

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

 



Add XE_MISSING_CASE macro to handle missing switch case

v2: Add comment about macro usage (Himal)

Cc: Andi Shyti <andi.shyti@xxxxxxxxxxxxxxx>
Signed-off-by: Badal Nilawar <badal.nilawar@xxxxxxxxx>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@xxxxxxxxx>
---
 drivers/gpu/drm/xe/xe_macros.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_macros.h b/drivers/gpu/drm/xe/xe_macros.h
index daf56c846d03..6c74c69920ed 100644
--- a/drivers/gpu/drm/xe/xe_macros.h
+++ b/drivers/gpu/drm/xe/xe_macros.h
@@ -15,4 +15,8 @@
 			    "Ioctl argument check failed at %s:%d: %s", \
 			    __FILE__, __LINE__, #cond), 1))
 
+/* Parameter to macro should be a variable name */
+#define XE_MISSING_CASE(x) WARN(1, "Missing case (%s == %ld)\n", \
+				__stringify(x), (long)(x))
+
 #endif
-- 
2.25.1




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux