提交 f8422308 编写于 作者: J Joe Perches 提交者: Linus Torvalds

checkpatch: update $declaration_macros, add uninitialized_var

Using uninitialized_var reports a false positive for "Missing blank line
after declarations".

Fix it by adding uninitialized_var to the $declaration_macros exceptions
list.

Move the macro list after $Type is declared.

Add optional prefixes to DECLARE_<FOO> and DEFINE_<BAR>
macro declarations to allow forms like:
	MLX4_DECLARE_DOORBELL_LOCK
Signed-off-by: NJoe Perches <joe@perches.com>
Reported-by: NDotan Barak <dotanb@mellanox.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 ece9659f
...@@ -423,11 +423,6 @@ foreach my $entry (@mode_permission_funcs) { ...@@ -423,11 +423,6 @@ foreach my $entry (@mode_permission_funcs) {
$mode_perms_search .= $entry->[0]; $mode_perms_search .= $entry->[0];
} }
our $declaration_macros = qr{(?x:
(?:$Storage\s+)?(?:DECLARE|DEFINE)_[A-Z]+\s*\(|
(?:$Storage\s+)?LIST_HEAD\s*\(
)};
our $allowed_asm_includes = qr{(?x: our $allowed_asm_includes = qr{(?x:
irq| irq|
memory memory
...@@ -490,6 +485,12 @@ our $balanced_parens = qr/(\((?:[^\(\)]++|(?-1))*\))/; ...@@ -490,6 +485,12 @@ our $balanced_parens = qr/(\((?:[^\(\)]++|(?-1))*\))/;
our $LvalOrFunc = qr{((?:[\&\*]\s*)?$Lval)\s*($balanced_parens{0,1})\s*}; our $LvalOrFunc = qr{((?:[\&\*]\s*)?$Lval)\s*($balanced_parens{0,1})\s*};
our $FuncArg = qr{$Typecast{0,1}($LvalOrFunc|$Constant)}; our $FuncArg = qr{$Typecast{0,1}($LvalOrFunc|$Constant)};
our $declaration_macros = qr{(?x:
(?:$Storage\s+)?(?:[A-Z_][A-Z0-9]*_){0,2}(?:DEFINE|DECLARE)(?:_[A-Z0-9]+){1,2}\s*\(|
(?:$Storage\s+)?LIST_HEAD\s*\(|
(?:$Storage\s+)?${Type}\s+uninitialized_var\s*\(
)};
sub deparenthesize { sub deparenthesize {
my ($string) = @_; my ($string) = @_;
return "" if (!defined($string)); return "" if (!defined($string));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册