aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorFlorian Vaussard <florian.vaussard@epfl.ch>2014-04-03 17:49:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-03 19:21:15 -0400
commitcc93319b5f2471ff2042ce62ea6da1f3bb3ce394 (patch)
tree88a35c29a29f0feb5f4fa3e1d272eec6f5967da4 /scripts
parent7dd05b38e5b729f412b617baad5c3363519cf1d4 (diff)
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>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 271d2f96b407..921c037f1968 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2080,9 +2080,11 @@ sub process {
2080 2080
2081 my @compats = $rawline =~ /\"([a-zA-Z0-9\-\,\.\+_]+)\"/g; 2081 my @compats = $rawline =~ /\"([a-zA-Z0-9\-\,\.\+_]+)\"/g;
2082 2082
2083 my $dt_path = $root . "/Documentation/devicetree/bindings/";
2084 my $vp_file = $dt_path . "vendor-prefixes.txt";
2085
2083 foreach my $compat (@compats) { 2086 foreach my $compat (@compats) {
2084 my $compat2 = $compat; 2087 my $compat2 = $compat;
2085 my $dt_path = $root . "/Documentation/devicetree/bindings/";
2086 $compat2 =~ s/\,[a-z]*\-/\,<\.\*>\-/; 2088 $compat2 =~ s/\,[a-z]*\-/\,<\.\*>\-/;
2087 `grep -Erq "$compat|$compat2" $dt_path`; 2089 `grep -Erq "$compat|$compat2" $dt_path`;
2088 if ( $? >> 8 ) { 2090 if ( $? >> 8 ) {
@@ -2090,14 +2092,12 @@ sub process {
2090 "DT compatible string \"$compat\" appears un-documented -- check $dt_path\n" . $herecurr); 2092 "DT compatible string \"$compat\" appears un-documented -- check $dt_path\n" . $herecurr);
2091 } 2093 }
2092 2094
2093 my $vendor_path = $dt_path . "vendor-prefixes.txt";
2094 next if (! -f $vendor_path);
2095 next if $compat !~ /^([a-zA-Z0-9\-]+)\,/; 2095 next if $compat !~ /^([a-zA-Z0-9\-]+)\,/;
2096 my $vendor = $1; 2096 my $vendor = $1;
2097 `grep -Eq "$vendor" $vendor_path`; 2097 `grep -Eq "^$vendor\\b" $vp_file`;
2098 if ( $? >> 8 ) { 2098 if ( $? >> 8 ) {
2099 WARN("UNDOCUMENTED_DT_STRING", 2099 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);
2101 } 2101 }
2102 } 2102 }
2103 } 2103 }