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.
Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all
Unified · Split
| @@ -4113,6 +4113,12 @@ sub process { · 4112 unmodified lines | ||
| 4113 | 4113 | "$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr); |
| 4114 | 4114 | } |
| 4115 | 4115 | |
| 4116 | +# check for GFP_NOWAIT use | |
| 4117 | + if ($line =~ /\b__GFP_NOFAIL\b/) { | |
| 4118 | + WARN("__GFP_NOFAIL", | |
| 4119 | + "Use of __GFP_NOFAIL is deprecated, no new users should be added\n" . $herecurr); | |
| 4120 | + } | |
| 4121 | + | |
| 4116 | 4122 | # check for multiple semicolons |
| 4117 | 4123 | if ($line =~ /;\s*;\s*$/) { |
| 4118 | 4124 | if (WARN("ONE_SEMICOLON", |