scripts: checkpatch remove device-tree doc check
authorPaul Spooren <mail@aparcar.org>
Mon, 3 Aug 2020 01:34:00 +0000 (15:34 -1000)
committerPetr Štetiar <ynezz@true.cz>
Thu, 12 Nov 2020 17:21:55 +0000 (18:21 +0100)
Remove checks for device tree documentation as the OpenWrt tree comes
withouth the ./Documentation folder.

Signed-off-by: Paul Spooren <mail@aparcar.org>
scripts/checkpatch.pl

index e12a244037bfbc9533e584766d662ffdde1b3402..9da28baf35361a735325cf1337126b23769fee67 100755 (executable)
@@ -2585,14 +2585,6 @@ sub process {
 
                        if ($realfile !~ /^MAINTAINERS/) {
                                my $last_binding_patch = $is_binding_patch;
-
-                               $is_binding_patch = () = $realfile =~ m@^(?:Documentation/devicetree/|include/dt-bindings/)@;
-
-                               if (($last_binding_patch != -1) &&
-                                   ($last_binding_patch ^ $is_binding_patch)) {
-                                       WARN("DT_SPLIT_BINDING_PATCH",
-                                            "DT binding docs and includes should be a separate patch. See: Documentation/devicetree/bindings/submitting-patches.rst\n");
-                               }
                        }
 
                        next;
@@ -2873,14 +2865,6 @@ sub process {
                             "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);
                }
 
-# Check for adding new DT bindings not in schema format
-               if (!$in_commit_log &&
-                   ($line =~ /^new file mode\s*\d+\s*$/) &&
-                   ($realfile =~ m@^Documentation/devicetree/bindings/.*\.txt$@)) {
-                       WARN("DT_SCHEMA_BINDING_PATCH",
-                            "DT bindings should be in DT schema format. See: Documentation/devicetree/writing-schema.rst\n");
-               }
-
 # Check for wrappage within a valid hunk of the file
                if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) {
                        ERROR("CORRUPTED_PATCH",
@@ -3118,37 +3102,6 @@ sub process {
                             "Use of $flag is deprecated, please use \`$replacement->{$flag} instead.\n" . $herecurr) if ($replacement->{$flag});
                }
 
-# check for DT compatible documentation
-               if (defined $root &&
-                       (($realfile =~ /\.dtsi?$/ && $line =~ /^\+\s*compatible\s*=\s*\"/) ||
-                        ($realfile =~ /\.[ch]$/ && $line =~ /^\+.*\.compatible\s*=\s*\"/))) {
-
-                       my @compats = $rawline =~ /\"([a-zA-Z0-9\-\,\.\+_]+)\"/g;
-
-                       my $dt_path = $root . "/Documentation/devicetree/bindings/";
-                       my $vp_file = $dt_path . "vendor-prefixes.yaml";
-
-                       foreach my $compat (@compats) {
-                               my $compat2 = $compat;
-                               $compat2 =~ s/\,[a-zA-Z0-9]*\-/\,<\.\*>\-/;
-                               my $compat3 = $compat;
-                               $compat3 =~ s/\,([a-z]*)[0-9]*\-/\,$1<\.\*>\-/;
-                               `grep -Erq "$compat|$compat2|$compat3" $dt_path`;
-                               if ( $? >> 8 ) {
-                                       WARN("UNDOCUMENTED_DT_STRING",
-                                            "DT compatible string \"$compat\" appears un-documented -- check $dt_path\n" . $herecurr);
-                               }
-
-                               next if $compat !~ /^([a-zA-Z0-9\-]+)\,/;
-                               my $vendor = $1;
-                               `grep -Eq "\\"\\^\Q$vendor\E,\\.\\*\\":" $vp_file`;
-                               if ( $? >> 8 ) {
-                                       WARN("UNDOCUMENTED_DT_STRING",
-                                            "DT compatible string vendor \"$vendor\" appears un-documented -- check $vp_file\n" . $herecurr);
-                               }
-                       }
-               }
-
 # check for using SPDX license tag at beginning of files
                if ($realline == $checklicenseline) {
                        if ($rawline =~ /^[ \+]\s*\#\!\s*\//) {