Skip to content

Commit 7e4915e

Browse files
rientjestorvalds
authored andcommitted
checkpatch: add warning of future __GFP_NOFAIL use
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent d2e248e commit 7e4915e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎scripts/checkpatch.pl‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4113,6 +4113,12 @@ sub process {
41134113
"$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr);
41144114
}
41154115

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+
41164122
# check for multiple semicolons
41174123
if ($line =~ /;\s*;\s*$/) {
41184124
if (WARN("ONE_SEMICOLON",

0 commit comments

Comments
 (0)