提交 f9b5c530 编写于 作者: M Mauro Carvalho Chehab 提交者: Jonathan Corbet

scripts/kernel-doc: fix handling of parameters with parenthesis

lib/crc32c defines one parameter as:
	const u32 (*tab)[256]

Better handle parenthesis, to avoid those warnings:

./lib/crc32.c:149: warning: No description found for parameter 'tab)[256]'
./lib/crc32.c:149: warning: Excess function parameter 'tab' description in 'crc32_le_generic'
./lib/crc32.c:294: warning: No description found for parameter 'tab)[256]'
./lib/crc32.c:294: warning: Excess function parameter 'tab' description in 'crc32_be_generic'
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: NJonathan Corbet <corbet@lwn.net>
上级 b97f193a
...@@ -2402,8 +2402,7 @@ sub push_parameter($$$) { ...@@ -2402,8 +2402,7 @@ sub push_parameter($$$) {
} }
$anon_struct_union = 0; $anon_struct_union = 0;
my $param_name = $param; $param =~ s/[\[\)].*//;
$param_name =~ s/\[.*//;
if ($type eq "" && $param =~ /\.\.\.$/) if ($type eq "" && $param =~ /\.\.\.$/)
{ {
...@@ -2434,9 +2433,9 @@ sub push_parameter($$$) { ...@@ -2434,9 +2433,9 @@ sub push_parameter($$$) {
# but inline preprocessor statements); # but inline preprocessor statements);
# also ignore unnamed structs/unions; # also ignore unnamed structs/unions;
if (!$anon_struct_union) { if (!$anon_struct_union) {
if (!defined $parameterdescs{$param_name} && $param_name !~ /^#/) { if (!defined $parameterdescs{$param} && $param !~ /^#/) {
$parameterdescs{$param_name} = $undescribed; $parameterdescs{$param} = $undescribed;
if (($type eq 'function') || ($type eq 'enum')) { if (($type eq 'function') || ($type eq 'enum')) {
print STDERR "${file}:$.: warning: Function parameter ". print STDERR "${file}:$.: warning: Function parameter ".
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册