Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1655679

[PATCH 1/2] checkpatch: Improve the unnecessary OOM message test

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject [PATCH 1/2] checkpatch: Improve the unnecessary OOM message test
Date 2017-06-01 21:10 +0200
Message-ID <tNDDP-6I5-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Use the context around a patch to avoid missing some candidates.

Signed-off-by: Joe Perches <joe@perches.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index f4ac18970e7e..b86ff852b241 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);
 			}
-- 
2.10.0.rc2.1.g053435c

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 1/2] checkpatch: Improve the unnecessary OOM message test Joe Perches <joe@perches.com> - 2017-06-01 21:10 +0200

csiph-web