Skip to content

Commit c950a17

Browse files
silvioJonathan Corbet
authored andcommitted
kernel-doc: better parsing of named variable arguments
Without this patch we get warnings for named variable arguments. warning: No description found for parameter '...' warning: Excess function parameter 'args' description in 'alloc_ordered_workqueue' Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com Signed-off-by: Jonathan Corbet <corbet@lwn.net>
1 parent 9d2cccd commit c950a17

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/kernel-doc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,15 @@ EOF
204204

205205
## init lots of data
206206

207+
207208
my $errors = 0;
208209
my $warnings = 0;
209210
my $anon_struct_union = 0;
210211

211212
# match expressions used to find embedded type information
212213
my $type_constant = '\%([-_\w]+)';
213214
my $type_func = '(\w+)\(\)';
214-
my $type_param = '\@(\w+)';
215+
my $type_param = '\@(\w+(\.\.\.)?)';
215216
my $type_fp_param = '\@(\w+)\(\)'; # Special RST handling for func ptr params
216217
my $type_struct = '\&((struct\s*)*[_\w]+)';
217218
my $type_struct_xml = '\\&amp;((struct\s*)*[_\w]+)';
@@ -2353,7 +2354,10 @@ sub push_parameter($$$) {
23532354

23542355
if ($type eq "" && $param =~ /\.\.\.$/)
23552356
{
2356-
$param = "...";
2357+
if (!$param =~ /\w\.\.\.$/) {
2358+
# handles unnamed variable parameters
2359+
$param = "...";
2360+
}
23572361
if (!defined $parameterdescs{$param} || $parameterdescs{$param} eq "") {
23582362
$parameterdescs{$param} = "variable arguments";
23592363
}

0 commit comments

Comments
 (0)