Skip to content

Commit e8f4ba8

Browse files
pm215Jonathan Corbet
authored andcommitted
scripts/kernel-doc: Add missing close-paren in c:function directives
When kernel-doc generates a 'c:function' directive for a function one of whose arguments is a function pointer, it fails to print the close-paren after the argument list of the function pointer argument. For instance: long work_on_cpu(int cpu, long (*fn) (void *, void * arg) in driver-api/basics.html is missing a ')' separating the "void *" of the 'fn' arguments from the ", void * arg" which is an argument to work_on_cpu(). Add the missing close-paren, so that we render the prototype correctly: long work_on_cpu(int cpu, long (*fn)(void *), void * arg) (Note that Sphinx stops rendering a space between the '(fn*)' and the '(void *)' once it gets something that's syntactically valid.) Signed-off-by: Peter Maydell <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Corbet <[email protected]>
1 parent 52338df commit e8f4ba8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/kernel-doc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ sub output_function_rst(%) {
853853

854854
if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
855855
# pointer-to-function
856-
print $1 . $parameter . ") (" . $2;
856+
print $1 . $parameter . ") (" . $2 . ")";
857857
} else {
858858
print $type . " " . $parameter;
859859
}

0 commit comments

Comments
 (0)