Skip to contentSkip to conversation

checkpatch: don't warn about complex macros in i.MX pin header

PATCH In review Peng Fan (OSS) 2 participants 2 messages Dec 16, 2025 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpatch: don't warn about complex macros in i.MX pin header

From: Peng Fan <[email protected]>

The pin function ID in i.MX pin headers is a tuple of <mux_reg conf_reg input_reg mux_mode input_val>, as below:
"#define IMX95_PAD_DAP_TDI__JTAG_MUX_TDI 0x0000 0x0204 0x0610 0x00 0x00" The pin headers are used by device trees, not drivers.

checkpatch erroneously flags it as error:
ERROR: Macros with complex values should be enclosed in parentheses

Bypass the check for pin header files with file names imx[*]-pinfunc.h.

---
 scripts/checkpatch.pl | 1 +
 1 file changed, 1 insertion(+)
scripts/checkpatch.pl +1 -0
index c0250244cf7a3cb5e289b04fa4a9f644692dc278..5e91698cb90751ae1f575b3d8094a3f6aa4ee3c6 100755
@@ -5937,6 +5937,7 @@ sub process {
 # (0) loop.  Grab the first statement and ensure its the whole macro
 # if its not enclosed in a known good container
 		if ($realfile !~ m@/vmlinux.lds.h$@ &&
+		    $realfile !~ m@/imx\d+-pinfunc\.h$@ &&
 		    $line =~ /^.\s*\#\s*define\s*$Ident(\()?/) {
 			my $ln = $linenr;
 			my $cnt = $realcnt;

---
base-commit: 563c8dd425b59e44470e28519107b1efc99f4c7b
change-id: 20251216-checkpatch-45226f317299

Best regards,

Signature · 1 line
Peng Fan <[email protected]>
maintainer
#1 lore raw
Quoted 6 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

The pin function ID in i.MX pin headers is a tuple of <mux_reg conf_reg input_reg mux_mode input_val>, as below:
"#define IMX95_PAD_DAP_TDI__JTAG_MUX_TDI 0x0000 0x0204 0x0610 0x00 0x00" The pin headers are used by device trees, not drivers.

Nak. Just ignore the message instead.

There would be _far_ too many exceptions to add individually to checkpatch.