diff options
author | Joe Perches <joe@perches.com> | 2017-07-11 00:52:04 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-11 01:32:35 +0200 |
commit | fb0d0e088e194e7d966c9a1b3c58900664e5d7db (patch) | |
tree | 1007b3d84c9d16fb9895c12afbf780c4836950cd /scripts/checkpatch.pl | |
parent | lib/bsearch.c: micro-optimize pivot position calculation (diff) | |
download | linux-fb0d0e088e194e7d966c9a1b3c58900664e5d7db.tar.xz linux-fb0d0e088e194e7d966c9a1b3c58900664e5d7db.zip |
checkpatch: improve the unnecessary OOM message test
Use the context around a patch to avoid missing some candidates.
Link: http://lkml.kernel.org/r/865e874fbae5decc331a849bd8d71c325db6bc80.1496343345.git.joe@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rwxr-xr-x | scripts/checkpatch.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 3a225d078e75..907e079e59fd 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5311,7 +5311,7 @@ sub process { my ($s, $c) = ctx_statement_block($linenr - 3, $realcnt, 0); # print("line: <$line>\nprevline: <$prevline>\ns: <$s>\nc: <$c>\n\n\n"); - if ($c =~ /(?:^|\n)[ \+]\s*(?:$Type\s*)?\Q$testval\E\s*=\s*(?:\([^\)]*\)\s*)?\s*(?:devm_)?(?:[kv][czm]alloc(?:_node|_array)?\b|kstrdup|(?:dev_)?alloc_skb)/) { + if ($s =~ /(?:^|\n)[ \+]\s*(?:$Type\s*)?\Q$testval\E\s*=\s*(?:\([^\)]*\)\s*)?\s*(?:devm_)?(?:[kv][czm]alloc(?:_node|_array)?\b|kstrdup|kmemdup|(?:dev_)?alloc_skb)/) { WARN("OOM_MESSAGE", "Possible unnecessary 'out of memory' message\n" . $hereprev); } |