summaryrefslogtreecommitdiff
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@canonical.com>2009-01-06 14:41:28 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-06 15:59:17 -0800
commit2d1bafd799ee0442979e6ce4145d58b69d3cade2 (patch)
tree83002f1bac78f652032aa00d81233fe75cbac175 /scripts/checkpatch.pl
parent4635f4fbaf51555509c747eed02a7e7a580ae1e1 (diff)
downloadlinux-stable-2d1bafd799ee0442979e6ce4145d58b69d3cade2.tar.gz
linux-stable-2d1bafd799ee0442979e6ce4145d58b69d3cade2.tar.bz2
linux-stable-2d1bafd799ee0442979e6ce4145d58b69d3cade2.zip
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 <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 906624c0e9e6..a521d493b0c8 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);
}