* [PATCH] checkpatch: Add .dtso to DT file extension checks
@ 2026-05-13 21:14 Vitor Soares
0 siblings, 0 replies; only message in thread
From: Vitor Soares @ 2026-05-13 21:14 UTC (permalink / raw)
To: Andy Whitcroft, Joe Perches
Cc: Vitor Soares, linux-kernel, Dwaipayan Ray, Lukas Bulwahn
From: Vitor Soares <vitor.soares@toradex.com>
Device tree overlay files (.dtso) were not matched by most DT-related
checks, causing them to be silently skipped for overlay patches.
Extend all DT file extension patterns to include .dtso and normalize
them to use non-capturing groups (?:...).
Closes: https://lore.kernel.org/all/20260513171514.889168-2-ivitro@gmail.com/
Assisted-by: Claude:claude-sonnet-4.6
Signed-off-by: Vitor Soares <vitor.soares@toradex.com>
---
scripts/checkpatch.pl | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 3727156e4cca..650d052918a3 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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;
@@ -3804,7 +3804,7 @@ sub process {
}
# Check for RGMII phy-mode with delay on PCB
- if ($realfile =~ /\.(dts|dtsi|dtso)$/ &&
+ if ($realfile =~ /\.(?:dts|dtsi|dtso)$/ &&
$line =~ /^\+\s*(phy-mode|phy-connection-type)\s*=\s*"/ &&
!ctx_has_comment($first_line, $linenr)) {
my $prop = $1;
@@ -3821,7 +3821,7 @@ sub process {
$checklicenseline = 2;
} elsif ($rawline =~ /^\+/) {
my $comment = "";
- if ($realfile =~ /\.(c|rs|dts|dtsi)$/) {
+ if ($realfile =~ /\.(?:c|rs|dts|dtsi|dtso)$/) {
$comment = '//';
} elsif (($checklicenseline == 2) || $realfile =~ /\.(sh|pl|py|awk|tc|yaml)$/) {
$comment = '#';
@@ -3883,7 +3883,7 @@ sub process {
}
# check we are in a valid source file if not then ignore this hunk
- next if ($realfile !~ /\.(h|c|rs|s|S|sh|dtsi|dts)$/);
+ next if ($realfile !~ /\.(?:h|c|rs|s|S|sh|dtsi|dts|dtso)$/);
# check for using SPDX-License-Identifier on the wrong line number
if ($realline != $checklicenseline &&
@@ -3982,7 +3982,7 @@ sub process {
}
# check we are in a valid source file C or perl if not then ignore this hunk
- next if ($realfile !~ /\.(h|c|pl|dtsi|dts)$/);
+ next if ($realfile !~ /\.(?:h|c|pl|dtsi|dts|dtso)$/);
# at the beginning of a line any tabs must come first and anything
# more than $tabsize must use tabs.
--
2.53.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-13 21:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-13 21:14 [PATCH] checkpatch: Add .dtso to DT file extension checks Vitor Soares
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox