]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
checkpatch: do not report nr_static as a static declaration
authorAndy Whitcroft <apw@canonical.com>
Tue, 6 Jan 2009 22:41:28 +0000 (14:41 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 6 Jan 2009 23:59:17 +0000 (15:59 -0800)
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>
scripts/checkpatch.pl

index 906624c0e9e6a6862631f085c263049e5d3eed58..a521d493b0c8600790d20b9574fc445d98f18d4a 100755 (executable)
@@ -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);
                }