提交 2d1bafd7 编写于 作者: A Andy Whitcroft 提交者: Linus Torvalds

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: NAndy Whitcroft <apw@canonical.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 4635f4fb
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册