mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] checkpatch: Ignore attribute macros ending with nGnRnE or nGnRE
@ 2026-03-07  7:27 Liu Dalin
  2026-03-07 19:53 ` Joe Perches
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Liu Dalin @ 2026-03-07  7:27 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches, Dwaipayan Ray, Lukas Bulwahn; +Cc: linux-kernel

On arm and arm64 platforms, there are several attribute macros that
end with nGnRnE or nGnRE, such as PROT_DEVICE_nGnRnE, PROT_DEVICE_nGnRE,
MT_DEVICE_nGnRnE, and MT_DEVICE_nGnRE.

Signed-off-by: Liu Dalin <liudalin@kylinsec.com.cn>
---
 scripts/checkpatch.pl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e56374662ff7..f5b5d72cb069 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5896,7 +5896,10 @@ sub process {
 #(ie: max_uV, regulator_min_uA_show, RANGE_mA_VALUE)
 			    $var !~ /^(?:[a-z0-9_]*|[A-Z0-9_]*)?_?[a-z][A-Z](?:_[a-z0-9_]+|_[A-Z0-9_]+)?$/ &&
 #Ignore some three character SI units explicitly, like MiB and KHz
-			    $var !~ /^(?:[a-z_]*?)_?(?:[KMGT]iB|[KMGT]?Hz)(?:_[a-z_]+)?$/) {
+			    $var !~ /^(?:[a-z_]*?)_?(?:[KMGT]iB|[KMGT]?Hz)(?:_[a-z_]+)?$/ &&
+#Ignore macros end with nGnRnE or nGnRE
+#(ie: PROT_DEVICE_<foo>, MT_DEVICE_<foo> MT_S2_DEVICE_<foo> ...)
+			    $var !~ /^[A-Z0-9_]+_(nGnRnE|nGnRE)$/) {
 				while ($var =~ m{\b($Ident)}g) {
 					my $word = $1;
 					next if ($word !~ /[A-Z][a-z]|[a-z][A-Z]/);
-- 
2.43.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-03-09  3:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-07  7:27 [PATCH] checkpatch: Ignore attribute macros ending with nGnRnE or nGnRE Liu Dalin
2026-03-07 19:53 ` Joe Perches
2026-03-09  2:12   ` Liu Dalin
2026-03-09  2:47     ` Joe Perches
2026-03-09  3:02       ` Liu Dalin
2026-03-09  2:45 ` [PATCH 0/1] checkpatch: ignore memory attribute macros ending with nGnRnE, nGnRE, or nGRE Liu Dalin
     [not found] ` <20260309024545.122002-1-liudalin@kylinsec.com.cn>
2026-03-09  2:45   ` [PATCH 1/1] " Liu Dalin

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®