diff options
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d89e4299c19d..05c99c0b7e6c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -2040,6 +2040,33 @@ sub process { | |||
2040 | "Use of $flag is deprecated, please use \`$replacement->{$flag} instead.\n" . $herecurr) if ($replacement->{$flag}); | 2040 | "Use of $flag is deprecated, please use \`$replacement->{$flag} instead.\n" . $herecurr) if ($replacement->{$flag}); |
2041 | } | 2041 | } |
2042 | 2042 | ||
2043 | # check for DT compatible documentation | ||
2044 | if (defined $root && $realfile =~ /\.dts/ && | ||
2045 | $rawline =~ /^\+\s*compatible\s*=/) { | ||
2046 | my @compats = $rawline =~ /\"([a-zA-Z0-9\-\,\.\+_]+)\"/g; | ||
2047 | |||
2048 | foreach my $compat (@compats) { | ||
2049 | my $compat2 = $compat; | ||
2050 | my $dt_path = $root . "/Documentation/devicetree/bindings/"; | ||
2051 | $compat2 =~ s/\,[a-z]*\-/\,<\.\*>\-/; | ||
2052 | `grep -Erq "$compat|$compat2" $dt_path`; | ||
2053 | if ( $? >> 8 ) { | ||
2054 | WARN("UNDOCUMENTED_DT_STRING", | ||
2055 | "DT compatible string \"$compat\" appears un-documented -- check $dt_path\n" . $herecurr); | ||
2056 | } | ||
2057 | |||
2058 | my $vendor = $compat; | ||
2059 | my $vendor_path = $dt_path . "vendor-prefixes.txt"; | ||
2060 | next if (! -f $vendor_path); | ||
2061 | $vendor =~ s/^([a-zA-Z0-9]+)\,.*/$1/; | ||
2062 | `grep -Eq "$vendor" $vendor_path`; | ||
2063 | if ( $? >> 8 ) { | ||
2064 | WARN("UNDOCUMENTED_DT_STRING", | ||
2065 | "DT compatible string vendor \"$vendor\" appears un-documented -- check $vendor_path\n" . $herecurr); | ||
2066 | } | ||
2067 | } | ||
2068 | } | ||
2069 | |||
2043 | # check we are in a valid source file if not then ignore this hunk | 2070 | # check we are in a valid source file if not then ignore this hunk |
2044 | next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/); | 2071 | next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/); |
2045 | 2072 | ||