The method for listing varargs in kernel-doc notation is: * @...: these arguments are printed by the @fmt argument but scripts/kernel-doc is confused: it always lists varargs as: ... variable arguments and ignores the @...: line's description, but then prints that line after the list of function parameters as though it's not part of the function parameters. This patch makes kernel-doc print the supplied @... description if it is present; otherwise a boilerplate "variable arguments" is printed.
Showing the changes to scripts/kernel-doc (1 of 1 file). Show all
Unified · Split
| @@ -378,6 +378,10 @@ sub dump_section { · 377 unmodified lines | ||
| 378 | 378 | # print STDERR "parameter def '$1' = '$contents'\n"; |
| 379 | 379 | $name = $1; |
| 380 | 380 | $parameterdescs{$name} = $contents; |
| 381 | + } elsif ($name eq "@\.\.\.") { | |
| 382 | +# print STDERR "parameter def '...' = '$contents'\n"; | |
| 383 | + $name = "..."; | |
| 384 | + $parameterdescs{$name} = $contents; | |
| 381 | 385 | } else { |
| 382 | 386 | # print STDERR "other section '$name' = '$contents'\n"; |
| 383 | 387 | if (defined($sections{$name}) && ($sections{$name} ne "")) { |
| @@ -1588,12 +1592,12 @@ sub push_parameter($$$) { · 1204 unmodified lines | ||
| 1588 | 1592 | |
| 1589 | 1593 | if ($type eq "" && $param =~ /\.\.\.$/) |
| 1590 | 1594 | { |
| 1591 | − $type=""; | |
| 1592 | − $parameterdescs{$param} = "variable arguments"; | |
| 1595 | + if (!defined $parameterdescs{$param} || $parameterdescs{$param} eq "") { | |
| 1596 | + $parameterdescs{$param} = "variable arguments"; | |
| 1597 | + } | |
| 1593 | 1598 | } |
| 1594 | 1599 | elsif ($type eq "" && ($param eq "" or $param eq "void")) |
| 1595 | 1600 | { |
| 1596 | − $type=""; | |
| 1597 | 1601 | $param="void"; |
| 1598 | 1602 | $parameterdescs{void} = "no arguments"; |
| 1599 | 1603 | } |