Skip to contentSkip to conversation

checkpatch: add .dtso to DT compatible string vendor check

PATCH In review Vitor Soares 2 participants 2 messages May 13 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpatch: add .dtso to DT compatible string vendor check

From: Vitor Soares <[email protected]>

Extend the DT compatible documentation check to match .dtso files so that vendor-prefixed compatibles in overlay files trigger the UNDOCUMENTED_DT_STRING warning when the vendor is absent from vendor-prefixes.yaml.

Assisted-by Claude:claude-sonnet-4.6
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
index 3727156e4cca..fac38fd84856 100755
@@ -3774,7 +3774,7 @@ sub process {
 
 # check for DT compatible documentation
 		if (defined $root &&
-			(($realfile =~ /\.dtsi?$/ && $line =~ /^\+\s*compatible\s*=\s*\"/) ||
+			(($realfile =~ /\.(dts|dtsi|dtso)$/ && $line =~ /^\+\s*compatible\s*=\s*\"/) ||
 			 ($realfile =~ /\.[ch]$/ && $line =~ /^\+.*\.compatible\s*=\s*\"/))) {
 
 			my @compats = $rawline =~ /\"([a-zA-Z0-9\-\,\.\+_]+)\"/g;
Signature · 1 line
2.53.0
maintainer
#1 lore raw
Quoted 7 lines · Vitor Soares

Extend the DT compatible documentation check to match .dtso files so that vendor-prefixed compatibles in overlay files trigger the UNDOCUMENTED_DT_STRING warning when the vendor is absent from vendor-prefixes.yaml.

Assisted-by Claude:claude-sonnet-4.6

[]

scripts/checkpatch.pl

Quoted 1 line
scripts/checkpatch.pl +0 -0

[]

scripts/checkpatch.pl sub process { · line 3777

Quoted 6 lines
scripts/checkpatch.pl +1 -1
@@ -3774,7 +3774,7 @@ sub process {
 
 # check for DT compatible documentation
 		if (defined $root &&
-			(($realfile =~ /\.dtsi?$/ && $line =~ /^\+\s*compatible\s*=\s*\"/) ||
+			(($realfile =~ /\.(dts|dtsi|dtso)$/ && $line =~ /^\+\s*compatible\s*=\s*\"/) ||

Use (?:...) to avoid capture groups.

And presumably all checks for dts.? files and locations should be modified

$ git grep -n dts scripts/checkpatch.pl
scripts/checkpatch.pl:3777:                     (($realfile =~ /\.dtsi?$/ && $line =~ /^\+\s*compatible\s*=\s*\"/) ||
scripts/checkpatch.pl:3807:             if ($realfile =~ /\.(dts|dtsi|dtso)$/ &&
scripts/checkpatch.pl:3824:                             if ($realfile =~ /\.(c|rs|dts|dtsi)$/) {
scripts/checkpatch.pl:3886:             next if ($realfile !~ /\.(h|c|rs|s|S|sh|dtsi|dts)$/);
scripts/checkpatch.pl:3985:             next if ($realfile !~ /\.(h|c|pl|dtsi|dts)$/);