From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
To: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>,
Dwaipayan Ray <dwaipayanray1@gmail.com>,
Lukas Bulwahn <lukas.bulwahn@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>
Subject: [PATCH] checkpatch: don't warn about complex macros in i.MX pin header
Date: Tue, 16 Dec 2025 16:32:24 +0800 [thread overview]
Message-ID: <20251216-checkpatch-v1-1-8d7a40a10426@nxp.com> (raw)
From: Peng Fan <peng.fan@nxp.com>
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.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
scripts/checkpatch.pl | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index c0250244cf7a3cb5e289b04fa4a9f644692dc278..5e91698cb90751ae1f575b3d8094a3f6aa4ee3c6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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,
--
Peng Fan <peng.fan@nxp.com>
next reply other threads:[~2025-12-16 8:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-16 8:32 Peng Fan (OSS) [this message]
2025-12-16 10:11 ` Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251216-checkpatch-v1-1-8d7a40a10426@nxp.com \
--to=peng.fan@oss.nxp.com \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=dwaipayanray1@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
--cc=peng.fan@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®