History

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'

Silvio Fricke committed 10 years ago

Commit c950a171 parent 9d2cccd1 file · +6 −2Browse files

Unified · Split

scripts/kernel-doc+6−2
@@ -204,6 +204,7 @@ EOF · 203 unmodified lines
204204
205205 ## init lots of data
206206
207+
207208 my $errors = 0;
208209 my $warnings = 0;
209210 my $anon_struct_union = 0;
@@ -211,7 +212,7 @@ my $anon_struct_union = 0; · 1 unmodified line
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 = '\\&((struct\s*)*[_\w]+)';
@@ -2353,7 +2354,10 @@ sub push_parameter($$$) { · 2135 unmodified lines
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 }