✗ CI.checkpatch: warning for User readable error codes on atomic_ioctl failure (rev2)

Patchwork patchwork at emeril.freedesktop.org
Fri Aug 22 07:09:04 UTC 2025


== Series Details ==

Series: User readable error codes on atomic_ioctl failure (rev2)
URL   : https://patchwork.freedesktop.org/series/152277/
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
553439844b6500767ce8aef522cfe9fbb7ece541
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 6157cc6938bb30d35d77ddfe3e937d84b4fe6e2c
Author: Arun R Murthy <arun.r.murthy at intel.com>
Date:   Fri Aug 22 12:30:04 2025 +0530

    drm/i915/display: Error codes for async flip failures
    
    For failures in async flip atomic check/commit path return user readable
    error codes in struct drm_atomic_state.
    
    Signed-off-by: Arun R Murthy <arun.r.murthy at intel.com>
+ /mt/dim checkpatch cca87ca63e2f5b8a785dc59c23e526987530b27f drm-intel
75f970864f7d drm: Define user readable error codes for atomic ioctl
-:39: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#39: FILE: include/uapi/drm/drm_mode.h:1161:
+#define DRM_MODE_ATOMIC_FAILURE_REASON \
+	FAILURE_REASON(DRM_MODE_ATOMIC_CAP_NOT_ENABLED, "DRM_ATOMIC capability not enabled") \
+	FAILURE_REASON(DRM_MODE_ATOMIC_INVALID_FLAG, "invalid flag") \
+	FAILURE_REASON(DRM_MODE_ATOMIC_PAGE_FLIP_ASYNC, "Legacy DRM_MODE_PAGE_FLIP_ASYNC not to be used in atomic ioctl") \
+	FAILURE_REASON(DRM_MODE_ATOMIC_FLIP_EVENT_WITH_CHECKONLY, "requesting page-flip event with TEST_ONLY") \
+	FAILURE_REASON(DRM_MODE_ATOMIC_CRTC_NEED_FULL_MODESET, "Need full modeset on this crtc") \
+	FAILURE_REASON(DRM_MODE_ATOMIC_NEED_FULL_MODESET, "Need full modeset on all the connected crtc's") \
+	FAILURE_REASON(DRM_MODE_ATOMIC_ASYNC_NOT_SUP_PLANE, "Async flip not supported on this plane") \
+	FAILURE_REASON(DRM_MODE_ATOMIC_ASYNC_MODIFIER_NOT_SUPPORTED, "Modifier not supported on this plane with async flip") \
+	FAILURE_REASON(DRM_MODE_ATOMIC_ASYNC_PROP_CHANGED, "No property change allowed when async flip is enabled")

BUT SEE:

   do {} while (0) advice is over-stated in a few situations:

   The more obvious case is macros, like MODULE_PARM_DESC, invoked at
   file-scope, where C disallows code (it must be in functions).  See
   $exceptions if you have one to add by name.

   More troublesome is declarative macros used at top of new scope,
   like DECLARE_PER_CPU.  These might just compile with a do-while-0
   wrapper, but would be incorrect.  Most of these are handled by
   detecting struct,union,etc declaration primitives in $exceptions.

   Theres also macros called inside an if (block), which "return" an
   expression.  These cannot do-while, and need a ({}) wrapper.

   Enjoy this qualification while we work to improve our heuristics.

-:42: WARNING:LONG_LINE: line length of 123 exceeds 100 columns
#42: FILE: include/uapi/drm/drm_mode.h:1164:
+	FAILURE_REASON(DRM_MODE_ATOMIC_PAGE_FLIP_ASYNC, "Legacy DRM_MODE_PAGE_FLIP_ASYNC not to be used in atomic ioctl") \

-:43: WARNING:LONG_LINE: line length of 112 exceeds 100 columns
#43: FILE: include/uapi/drm/drm_mode.h:1165:
+	FAILURE_REASON(DRM_MODE_ATOMIC_FLIP_EVENT_WITH_CHECKONLY, "requesting page-flip event with TEST_ONLY") \

-:45: WARNING:LONG_LINE: line length of 108 exceeds 100 columns
#45: FILE: include/uapi/drm/drm_mode.h:1167:
+	FAILURE_REASON(DRM_MODE_ATOMIC_NEED_FULL_MODESET, "Need full modeset on all the connected crtc's") \

-:46: WARNING:LONG_LINE: line length of 103 exceeds 100 columns
#46: FILE: include/uapi/drm/drm_mode.h:1168:
+	FAILURE_REASON(DRM_MODE_ATOMIC_ASYNC_NOT_SUP_PLANE, "Async flip not supported on this plane") \

-:47: WARNING:LONG_LINE: line length of 126 exceeds 100 columns
#47: FILE: include/uapi/drm/drm_mode.h:1169:
+	FAILURE_REASON(DRM_MODE_ATOMIC_ASYNC_MODIFIER_NOT_SUPPORTED, "Modifier not supported on this plane with async flip") \

-:48: WARNING:LONG_LINE: line length of 115 exceeds 100 columns
#48: FILE: include/uapi/drm/drm_mode.h:1170:
+	FAILURE_REASON(DRM_MODE_ATOMIC_ASYNC_PROP_CHANGED, "No property change allowed when async flip is enabled")

-:50: WARNING:MACRO_ARG_UNUSED: Argument 'reason' is not used in function-like macro
#50: FILE: include/uapi/drm/drm_mode.h:1172:
+#define FAILURE_REASON(flag, reason) flag,

-:51: WARNING:NEW_TYPEDEFS: do not add new typedefs
#51: FILE: include/uapi/drm/drm_mode.h:1173:
+typedef enum {

-:56: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#56: FILE: include/uapi/drm/drm_mode.h:1178:
+#define FAILURE_REASON(flag, reason) #reason,

BUT SEE:

   do {} while (0) advice is over-stated in a few situations:

   The more obvious case is macros, like MODULE_PARM_DESC, invoked at
   file-scope, where C disallows code (it must be in functions).  See
   $exceptions if you have one to add by name.

   More troublesome is declarative macros used at top of new scope,
   like DECLARE_PER_CPU.  These might just compile with a do-while-0
   wrapper, but would be incorrect.  Most of these are handled by
   detecting struct,union,etc declaration primitives in $exceptions.

   Theres also macros called inside an if (block), which "return" an
   expression.  These cannot do-while, and need a ({}) wrapper.

   Enjoy this qualification while we work to improve our heuristics.

-:56: WARNING:MACRO_ARG_UNUSED: Argument 'flag' is not used in function-like macro
#56: FILE: include/uapi/drm/drm_mode.h:1178:
+#define FAILURE_REASON(flag, reason) #reason,

total: 2 errors, 9 warnings, 0 checks, 54 lines checked
2de9aaf954be drm/atomic: Add error_code element in atomic_state
8df799dcfa6e drm/atomic: Return user readable error in atomic_ioctl
-:64: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#64: FILE: drivers/gpu/drm/drm_atomic_uapi.c:1388:
+#define FAILURE_REASON(flag, reason) #reason,

BUT SEE:

   do {} while (0) advice is over-stated in a few situations:

   The more obvious case is macros, like MODULE_PARM_DESC, invoked at
   file-scope, where C disallows code (it must be in functions).  See
   $exceptions if you have one to add by name.

   More troublesome is declarative macros used at top of new scope,
   like DECLARE_PER_CPU.  These might just compile with a do-while-0
   wrapper, but would be incorrect.  Most of these are handled by
   detecting struct,union,etc declaration primitives in $exceptions.

   Theres also macros called inside an if (block), which "return" an
   expression.  These cannot do-while, and need a ({}) wrapper.

   Enjoy this qualification while we work to improve our heuristics.

-:64: WARNING:MACRO_ARG_UNUSED: Argument 'flag' is not used in function-like macro
#64: FILE: drivers/gpu/drm/drm_atomic_uapi.c:1388:
+#define FAILURE_REASON(flag, reason) #reason,

total: 1 errors, 1 warnings, 0 checks, 146 lines checked
6157cc6938bb drm/i915/display: Error codes for async flip failures




More information about the Intel-xe mailing list