]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
checkpatch: add warning of future __GFP_NOFAIL use
authorDavid Rientjes <rientjes@google.com>
Fri, 3 Jan 2014 03:10:17 +0000 (14:10 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 3 Jan 2014 03:10:17 +0000 (14:10 +1100)
gfp.h and page_alloc.c already specify that __GFP_NOFAIL is deprecated and
no new users should be added.

Add a warning to checkpatch to catch this.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
scripts/checkpatch.pl

index e5a6a5246fb7f0f859740d90c8694087200d4aae..09500845dbbab2425b1ced1ddb8f03c1cb449bc2 100755 (executable)
@@ -4110,6 +4110,12 @@ sub process {
                             "$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr);
                }
 
+# check for GFP_NOWAIT use
+               if ($line =~ /\b__GFP_NOFAIL\b/) {
+                       WARN("__GFP_NOFAIL",
+                            "Use of __GFP_NOFAIL is deprecated, no new users should be added\n" . $herecurr);
+               }
+
 # check for multiple semicolons
                if ($line =~ /;\s*;\s*$/) {
                        if (WARN("ONE_SEMICOLON",