kernel-doc: handle varargs cleanly

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.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Randy Dunlap and committed by Linus Torvalds ced69090 6ff2d39b

+7 -3
+7 -3
scripts/kernel-doc
··· 378 # print STDERR "parameter def '$1' = '$contents'\n"; 379 $name = $1; 380 $parameterdescs{$name} = $contents; 381 } else { 382 # print STDERR "other section '$name' = '$contents'\n"; 383 if (defined($sections{$name}) && ($sections{$name} ne "")) { ··· 1592 1593 if ($type eq "" && $param =~ /\.\.\.$/) 1594 { 1595 - $type=""; 1596 - $parameterdescs{$param} = "variable arguments"; 1597 } 1598 elsif ($type eq "" && ($param eq "" or $param eq "void")) 1599 { 1600 - $type=""; 1601 $param="void"; 1602 $parameterdescs{void} = "no arguments"; 1603 }
··· 378 # print STDERR "parameter def '$1' = '$contents'\n"; 379 $name = $1; 380 $parameterdescs{$name} = $contents; 381 + } elsif ($name eq "@\.\.\.") { 382 + # print STDERR "parameter def '...' = '$contents'\n"; 383 + $name = "..."; 384 + $parameterdescs{$name} = $contents; 385 } else { 386 # print STDERR "other section '$name' = '$contents'\n"; 387 if (defined($sections{$name}) && ($sections{$name} ne "")) { ··· 1588 1589 if ($type eq "" && $param =~ /\.\.\.$/) 1590 { 1591 + if (!defined $parameterdescs{$param} || $parameterdescs{$param} eq "") { 1592 + $parameterdescs{$param} = "variable arguments"; 1593 + } 1594 } 1595 elsif ($type eq "" && ($param eq "" or $param eq "void")) 1596 { 1597 $param="void"; 1598 $parameterdescs{void} = "no arguments"; 1599 }