diff mbox series

drm/xe: Fix build error for XE_IOCTL_DBG macro

Message ID 20241027045752.10530-1-gye976@gmail.com (mailing list archive)
State New
Headers show
Series drm/xe: Fix build error for XE_IOCTL_DBG macro | expand

Commit Message

Gyeyoung Baek Oct. 27, 2024, 4:57 a.m. UTC
In the previous code, there is build error.
if CONFIG_DRM_USE_DYNAMIC_DEBUG is set,
'drm_dbg' function is replaced with '__dynamic_func_call_cls',
which is replaced with a do while statement.

The problem is that,
XE_IOCTL_DBG uses this function for conditional expression.

so I fix the expression to be compatible with the do while statement,
by referring to "https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html".

Signed-off-by: Gyeyoung Baek <gye976@gmail.com>
---
 drivers/gpu/drm/xe/xe_macros.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/xe/xe_macros.h b/drivers/gpu/drm/xe/xe_macros.h
index daf56c846d03..58a9d1e33502 100644
--- a/drivers/gpu/drm/xe/xe_macros.h
+++ b/drivers/gpu/drm/xe/xe_macros.h
@@ -11,8 +11,8 @@ 
 #define XE_WARN_ON WARN_ON
 
 #define XE_IOCTL_DBG(xe, cond) \
-	((cond) && (drm_dbg(&(xe)->drm, \
-			    "Ioctl argument check failed at %s:%d: %s", \
-			    __FILE__, __LINE__, #cond), 1))
+	({drm_dbg(&(xe)->drm, \
+		"Ioctl argument check failed at %s:%d: %s", \
+		__FILE__, __LINE__, #cond); (cond); })
 
 #endif