Skip to content

Commit

Permalink
checkpatch: do not report nr_static as a static declaration
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andy Whitcroft authored and Linus Torvalds committed Jan 6, 2009
1 parent 4635f4f commit 2d1bafd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 2d1bafd

Please sign in to comment.