]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
kernel-doc: handle varargs cleanly
authorRandy Dunlap <randy.dunlap@oracle.com>
Mon, 1 Dec 2008 21:14:03 +0000 (13:14 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 2 Dec 2008 03:55:25 +0000 (19:55 -0800)
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>
scripts/kernel-doc

index a53e2fc8dfb539575fa2e6f2001cb79b83251b8a..d27aad78e1d83f21a4c0f8140b0aa87be05ad4b4 100755 (executable)
@@ -378,6 +378,10 @@ sub dump_section {
 #      print STDERR "parameter def '$1' = '$contents'\n";
        $name = $1;
        $parameterdescs{$name} = $contents;
+    } elsif ($name eq "@\.\.\.") {
+#      print STDERR "parameter def '...' = '$contents'\n";
+       $name = "...";
+       $parameterdescs{$name} = $contents;
     } else {
 #      print STDERR "other section '$name' = '$contents'\n";
        if (defined($sections{$name}) && ($sections{$name} ne "")) {
@@ -1588,12 +1592,12 @@ sub push_parameter($$$) {
 
        if ($type eq "" && $param =~ /\.\.\.$/)
        {
-           $type="";
-           $parameterdescs{$param} = "variable arguments";
+           if (!defined $parameterdescs{$param} || $parameterdescs{$param} eq "") {
+               $parameterdescs{$param} = "variable arguments";
+           }
        }
        elsif ($type eq "" && ($param eq "" or $param eq "void"))
        {
-           $type="";
            $param="void";
            $parameterdescs{void} = "no arguments";
        }