Skip to content

Commit a62d563

Browse files
committed
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 in the memory API documentation: .. c:function:: void memory_region_init_resizeable_ram (MemoryRegion * mr, struct Object * owner, const char * name, uint64_t size, uint64_t max_size, void (*resized) (const char*, uint64_t length, void *host, Error ** errp) which should have a ')' after the 'void *host' which is the last argument to 'resized'. Older versions of Sphinx don't try to parse the argumnet to c:function, but Sphinx 3.0 does do this and will complain: /home/petmay01/linaro/qemu-from-laptop/qemu/docs/../include/exec/memory.h:834: WARNING: Error in declarator or parameters Invalid C declaration: Expecting "," or ")" in parameters, got "EOF". [error at 208] void memory_region_init_resizeable_ram (MemoryRegion * mr, struct Object * owner, const char * name, uint64_t size, uint64_t max_size, void (*resized) (const char*, uint64_t length, void *host, Error ** errp) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^ Add the missing close-paren. Signed-off-by: Peter Maydell <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Message-id: [email protected] Reviewed-by: Alex Bennée <[email protected]>
1 parent 516e8b7 commit a62d563

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)