]> git.karo-electronics.de Git - linux-beck.git/blobdiff - scripts/checkpatch.pl
Merge git://git.kvack.org/~bcrl/aio-next
[linux-beck.git] / scripts / checkpatch.pl
index 862cc7a740e23dfa59c7fe3187b5f4452b26d6f0..010b18ef4ea0cb9e1575b9e54f3922c7bd7f9888 100755 (executable)
@@ -1944,6 +1944,12 @@ sub process {
                        }
                }
 
+# Check for old stable address
+               if ($line =~ /^\s*cc:\s*.*<?\bstable\@kernel\.org\b>?.*$/i) {
+                       ERROR("STABLE_ADDRESS",
+                             "The 'stable' address should be 'stable\@vger.kernel.org'\n" . $herecurr);
+               }
+
 # Check for unwanted Gerrit info
                if ($in_commit_log && $line =~ /^\s*change-id:/i) {
                        ERROR("GERRIT_CHANGE_ID",
@@ -3470,6 +3476,13 @@ sub process {
                        }
                }
 
+# unnecessary return in a void function? (a single leading tab, then return;)
+               if ($sline =~ /^\+\treturn\s*;\s*$/ &&
+                   $prevline =~ /^\+/) {
+                       WARN("RETURN_VOID",
+                            "void function return statements are not generally useful\n" . $herecurr);
+               }
+
 # if statements using unnecessary parentheses - ie: if ((foo == bar))
                if ($^V && $^V ge 5.10.0 &&
                    $line =~ /\bif\s*((?:\(\s*){2,})/) {
@@ -4538,10 +4551,10 @@ sub process {
                             "$1 is obsolete, use k$3 instead\n" . $herecurr);
                }
 
-# check for __initcall(), use device_initcall() explicitly please
+# check for __initcall(), use device_initcall() explicitly or more appropriate function please
                if ($line =~ /^.\s*__initcall\s*\(/) {
                        WARN("USE_DEVICE_INITCALL",
-                            "please use device_initcall() instead of __initcall()\n" . $herecurr);
+                            "please use device_initcall() or more appropriate function instead of __initcall() (see include/linux/init.h)\n" . $herecurr);
                }
 
 # check for various ops structs, ensure they are const.