✗ CI.checkpatch: warning for drm/xe: Fix build error for XE_IOCTL_DBG macro (rev5)

Patchwork patchwork at emeril.freedesktop.org
Mon Nov 4 16:57:19 UTC 2024


== Series Details ==

Series: drm/xe: Fix build error for XE_IOCTL_DBG macro (rev5)
URL   : https://patchwork.freedesktop.org/series/140594/
State : warning

== Summary ==

+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt
Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master
30ab6715fc09baee6cc14cb3c89ad8858688d474
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 452d5f2ac0a5197c1d2a336cd9f98d945b5949c2
Author: Gyeyoung Baek <gye976 at gmail.com>
Date:   Sat Nov 2 11:22:03 2024 +0900

    drm/xe: Fix build error for XE_IOCTL_DBG macro
    
    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.
    so in the previous code, there are the following build errors.
    
    include/linux/dynamic_debug.h:221:58: error: expected expression before ‘do’
      221 | #define __dynamic_func_call_cls(id, cls, fmt, func, ...) do {   \
          |                                                          ^~
    include/linux/dynamic_debug.h:248:9: note: in expansion of macro ‘__dynamic_func_call_cls’
      248 |         __dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS__)
          |         ^~~~~~~~~~~~~~~~~~~~~~~
    include/drm/drm_print.h:425:9: note: in expansion of macro ‘_dynamic_func_call_cls’
      425 |         _dynamic_func_call_cls(cat, fmt, __drm_dev_dbg,         \
          |         ^~~~~~~~~~~~~~~~~~~~~~
    include/drm/drm_print.h:504:9: note: in expansion of macro ‘drm_dev_dbg’
      504 |         drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_DRIVER, fmt, ##__VA_ARGS__)
          |         ^~~~~~~~~~~
    include/drm/drm_print.h:522:33: note: in expansion of macro ‘drm_dbg_driver’
      522 | #define drm_dbg(drm, fmt, ...)  drm_dbg_driver(drm, fmt, ##__VA_ARGS__)
          |                                 ^~~~~~~~~~~~~~
    drivers/gpu/drm/xe/xe_macros.h:14:21: note: in expansion of macro ‘drm_dbg’
       14 |         ((cond) && (drm_dbg(&(xe)->drm, \
          |                     ^~~~~~~
    drivers/gpu/drm/xe/xe_bo.c:2029:13: note: in expansion of macro ‘XE_IOCTL_DBG’
     2029 |         if (XE_IOCTL_DBG(xe, !gem_obj))
    
    the problem is that,
    XE_IOCTL_DBG uses this function for conditional expr.
    
    so I fix the expr to be compatible with the do while statement,
    by referring to "https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html".
    
    v2: I modified this to print when only cond is true.
    v3: Modify to evaluate cond only once.
    v4: There was a mistake in v3, send this again.
    
    Signed-off-by: Gyeyoung Baek <gye976 at gmail.com>
+ /mt/dim checkpatch 0a6cc4357ae4d824f909468ca1deed28ae5ac96f drm-intel
452d5f2ac0a5 drm/xe: Fix build error for XE_IOCTL_DBG macro
-:18: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#18: 
  248 |         __dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS__)

-:61: WARNING:SPACE_BEFORE_TAB: please, no space before tabs
#61: FILE: drivers/gpu/drm/xe/xe_macros.h:15:
+^Iif (cond__)                                           ^I^I\$

-:62: WARNING:SPACE_BEFORE_TAB: please, no space before tabs
#62: FILE: drivers/gpu/drm/xe/xe_macros.h:16:
+^I^Idrm_dbg(&(xe)->drm,                                    ^I\$

-:64: WARNING:SPACE_BEFORE_TAB: please, no space before tabs
#64: FILE: drivers/gpu/drm/xe/xe_macros.h:18:
+^I^I^I__FILE__, __LINE__, #cond);                    ^I\$

-:65: WARNING:SPACE_BEFORE_TAB: please, no space before tabs
#65: FILE: drivers/gpu/drm/xe/xe_macros.h:19:
+^Icond__;                                                        ^I\$

total: 0 errors, 5 warnings, 0 checks, 17 lines checked




More information about the Intel-xe mailing list