Commit 2d1bafd799ee0442979e6ce4145d58b69d3cade2

Authored by Andy Whitcroft
Committed by Linus Torvalds
1 parent 4635f4fbaf

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

scripts/checkpatch.pl
... ... @@ -1632,7 +1632,7 @@
1632 1632 $herecurr);
1633 1633 }
1634 1634 # check for static initialisers.
1635   - if ($line =~ /\s*static\s.*=\s*(0|NULL|false)\s*;/) {
  1635 + if ($line =~ /\bstatic\s.*=\s*(0|NULL|false)\s*;/) {
1636 1636 ERROR("do not initialise statics to 0 or NULL\n" .
1637 1637 $herecurr);
1638 1638 }