Skip to content

Commit ef00028

Browse files
author
Jonathan Corbet
committed
docs: make kernel-doc handle varargs properly
As far as I can tell, the handling of "..." arguments has never worked right, so any documentation provided was ignored in favor of "variable arguments." This makes kernel-doc handle "@...:" as documented. It does *not* fix spots in kerneldoc comments that don't follow that convention, but they are no more broken than before. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
1 parent 9d9cce7 commit ef00028

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

scripts/kernel-doc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ my $doc_com_body = '\s*\* ?';
412412
my $doc_decl = $doc_com . '(\w+)';
413413
# @params and a strictly limited set of supported section names
414414
my $doc_sect = $doc_com .
415-
'\s*(\@\w+|description|context|returns?|notes?|examples?)\s*:(.*)';
415+
'\s*(\@[.\w]+|\@\.\.\.|description|context|returns?|notes?|examples?)\s*:(.*)';
416416
my $doc_content = $doc_com_body . '(.*)';
417417
my $doc_block = $doc_com . 'DOC:\s*(.*)?';
418418
my $doc_inline_start = '^\s*/\*\*\s*$';
@@ -2351,6 +2351,7 @@ sub push_parameter($$$) {
23512351

23522352
if ($type eq "" && $param =~ /\.\.\.$/)
23532353
{
2354+
$param = "...";
23542355
if (!defined $parameterdescs{$param} || $parameterdescs{$param} eq "") {
23552356
$parameterdescs{$param} = "variable arguments";
23562357
}

0 commit comments

Comments
 (0)