mm: remove offlining arg to migrate_pages
[platform/adaptation/renesas_rcar/renesas_kernel.git] / scripts / checkpatch.pl
index 2c50eb4..747bcd7 100755 (executable)
@@ -3253,9 +3253,9 @@ sub process {
                }
 
 # prefer usleep_range over udelay
-               if ($line =~ /\budelay\s*\(\s*(\w+)\s*\)/) {
+               if ($line =~ /\budelay\s*\(\s*(\d+)\s*\)/) {
                        # ignore udelay's < 10, however
-                       if (! (($1 =~ /(\d+)/) && ($1 < 10)) ) {
+                       if (! ($1 < 10) ) {
                                CHK("USLEEP_RANGE",
                                    "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt\n" . $line);
                        }
@@ -3476,6 +3476,12 @@ sub process {
                             "unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr);
                }
 
+# check for alloc argument mismatch
+               if ($line =~ /\b(kcalloc|kmalloc_array)\s*\(\s*sizeof\b/) {
+                       WARN("ALLOC_ARRAY_ARGS",
+                            "$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr);
+               }
+
 # check for multiple semicolons
                if ($line =~ /;\s*;\s*$/) {
                        WARN("ONE_SEMICOLON",