Merge tag 'sound-fix-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
[linux-2.6-microblaze.git] / scripts / checkpatch.pl
index 64890be..7cbe6e7 100755 (executable)
@@ -874,14 +874,18 @@ sub seed_camelcase_file {
        }
 }
 
+our %maintained_status = ();
+
 sub is_maintained_obsolete {
        my ($filename) = @_;
 
        return 0 if (!$tree || !(-e "$root/scripts/get_maintainer.pl"));
 
-       my $status = `perl $root/scripts/get_maintainer.pl --status --nom --nol --nogit --nogit-fallback -f $filename 2>&1`;
+       if (!exists($maintained_status{$filename})) {
+               $maintained_status{$filename} = `perl $root/scripts/get_maintainer.pl --status --nom --nol --nogit --nogit-fallback -f $filename 2>&1`;
+       }
 
-       return $status =~ /obsolete/i;
+       return $maintained_status{$filename} =~ /obsolete/i;
 }
 
 sub is_SPDX_License_valid {
@@ -2826,6 +2830,14 @@ 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",
@@ -5030,8 +5042,9 @@ sub process {
                            $var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&
 #Ignore Page<foo> variants
                            $var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ &&
-#Ignore SI style variants like nS, mV and dB (ie: max_uV, regulator_min_uA_show)
-                           $var !~ /^(?:[a-z_]*?)_?[a-z][A-Z](?:_[a-z_]+)?$/ &&
+#Ignore SI style variants like nS, mV and dB
+#(ie: max_uV, regulator_min_uA_show, RANGE_mA_VALUE)
+                           $var !~ /^(?:[a-z0-9_]*|[A-Z0-9_]*)?_?[a-z][A-Z](?:_[a-z0-9_]+|_[A-Z0-9_]+)?$/ &&
 #Ignore some three character SI units explicitly, like MiB and KHz
                            $var !~ /^(?:[a-z_]*?)_?(?:[KMGT]iB|[KMGT]?Hz)(?:_[a-z_]+)?$/) {
                                while ($var =~ m{($Ident)}g) {