✗ CI.checkpatch: warning for drm/xe/rtp: OA register whitelist fixes

Patchwork
2026-04-14T04:00:38Z

== Series Details ==

Series: drm/xe/rtp: OA register whitelist fixes
URL : https://patchwork.freedesktop.org/series/164832/
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
1f57ba1afceae32108bd24770069f764d940a0e4
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit f8ef9add73b1772b10c4d698503d9c31f02fb03c
Author: Ashutosh Dixit <ashutosh.dixit@intel.com>
Date: Mon Apr 13 20:52:44 2026 -0700

drm/xe/rtp: Fix offset alignment for MERT WHITELIST_OA_MERT_MMIO_TRG

'tail_buf' argument for WHITELIST_OA_MERT_MMIO_TRG was previously
wrong (not multiple of 16). Fix this.

Fixes: ec02e49f21bc ("drm/xe/rtp: Whitelist OAMERT MMIO trigger registers")
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
+ /mt/dim checkpatch c8bad7becc008716c8475847328c549e178c813c drm-intel
a0e5bbbdd1de drm/xe/rtp: Don't whitelist OA status registers
-:21: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#21: FILE: drivers/gpu/drm/xe/xe_reg_whitelist.c:93:
+#define WHITELIST_OA_MMIO_TRG(trg, head) \
WHITELIST(trg, RING_FORCE_TO_NONPRIV_ACCESS_RW), \
WHITELIST(head, RING_FORCE_TO_NONPRIV_ACCESS_RD | RING_FORCE_TO_NONPRIV_RANGE_4)

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.

total: 1 errors, 0 warnings, 0 checks, 30 lines checked
0eabbd85474b drm/xe/rtp: Don't whitelist OA head pointer registers
-:24: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#24: FILE: drivers/gpu/drm/xe/xe_reg_whitelist.c:93:
+#define WHITELIST_OA_MMIO_TRG(trg, tail_buf) \
WHITELIST(trg, RING_FORCE_TO_NONPRIV_ACCESS_RW), \
+ WHITELIST(tail_buf, RING_FORCE_TO_NONPRIV_ACCESS_RD | RING_FORCE_TO_NONPRIV_RANGE_4)

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.

total: 1 errors, 0 warnings, 0 checks, 11 lines checked
f8ef9add73b1 drm/xe/rtp: Fix offset alignment for MERT WHITELIST_OA_MERT_MMIO_TRG