]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - scripts/checkpatch.pl
Merge tag 'xfs-5.4-merge-8' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[linux.git] / scripts / checkpatch.pl
index 4eb355d8ae730529228664f9f028eac6c558fc5d..6fcc66afb088083080a4b492be6af4b67d4c1430 100755 (executable)
@@ -6507,6 +6507,12 @@ sub process {
                             "Using $1 should generally have parentheses around the comparison\n" . $herecurr);
                }
 
+# nested likely/unlikely calls
+               if ($line =~ /\b(?:(?:un)?likely)\s*\(\s*!?\s*(IS_ERR(?:_OR_NULL|_VALUE)?|WARN)/) {
+                       WARN("LIKELY_MISUSE",
+                            "nested (un)?likely() calls, $1 already uses unlikely() internally\n" . $herecurr);
+               }
+
 # whine mightly about in_atomic
                if ($line =~ /\bin_atomic\s*\(/) {
                        if ($realfile =~ m@^drivers/@) {