From 2d1bafd799ee0442979e6ce4145d58b69d3cade2 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Tue, 6 Jan 2009 14:41:28 -0800 Subject: [PATCH] checkpatch: do not report nr_static as a static declaration Ensure we do not report identifiers containing the word static as static declarations. For example this should not be reported as an unecessary assignement of 0: long nr_static = 0; Signed-off-by: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 906624c..a521d493 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1632,7 +1632,7 @@ sub process { $herecurr); } # check for static initialisers. - if ($line =~ /\s*static\s.*=\s*(0|NULL|false)\s*;/) { + if ($line =~ /\bstatic\s.*=\s*(0|NULL|false)\s*;/) { ERROR("do not initialise statics to 0 or NULL\n" . $herecurr); } -- 2.7.4