Skip to content

Commit cc93319

Browse files
Florian Vaussardtorvalds
authored andcommitted
checkpatch: improve the compatible vendor match
Improve the vendor name match in vendor-prefix.txt by only matching the exact vendor name at the beginning of lines. Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch> Cc: Joe Perches <joe@perches.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 7dd05b3 commit cc93319

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎scripts/checkpatch.pl‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,24 +2080,24 @@ sub process {
20802080

20812081
my @compats = $rawline =~ /\"([a-zA-Z0-9\-\,\.\+_]+)\"/g;
20822082

2083+
my $dt_path = $root . "/Documentation/devicetree/bindings/";
2084+
my $vp_file = $dt_path . "vendor-prefixes.txt";
2085+
20832086
foreach my $compat (@compats) {
20842087
my $compat2 = $compat;
2085-
my $dt_path = $root . "/Documentation/devicetree/bindings/";
20862088
$compat2 =~ s/\,[a-z]*\-/\,<\.\*>\-/;
20872089
`grep -Erq "$compat|$compat2" $dt_path`;
20882090
if ( $? >> 8 ) {
20892091
WARN("UNDOCUMENTED_DT_STRING",
20902092
"DT compatible string \"$compat\" appears un-documented -- check $dt_path\n" . $herecurr);
20912093
}
20922094

2093-
my $vendor_path = $dt_path . "vendor-prefixes.txt";
2094-
next if (! -f $vendor_path);
20952095
next if $compat !~ /^([a-zA-Z0-9\-]+)\,/;
20962096
my $vendor = $1;
2097-
`grep -Eq "$vendor" $vendor_path`;
2097+
`grep -Eq "^$vendor\\b" $vp_file`;
20982098
if ( $? >> 8 ) {
20992099
WARN("UNDOCUMENTED_DT_STRING",
2100-
"DT compatible string vendor \"$vendor\" appears un-documented -- check $vendor_path\n" . $herecurr);
2100+
"DT compatible string vendor \"$vendor\" appears un-documented -- check $vp_file\n" . $herecurr);
21012101
}
21022102
}
21032103
}

0 commit comments

Comments
 (0)