Skip to content

Commit 365757c

Browse files
schodetreturn42
authored andcommitted
[kernel-doc] fix extra space on function typedef return type
The typedef return type regex matches the space between typedef and the function return type. Drop those space. This solves a wrong warning for this kind of definition: /** * typedef sum - Sum function pointer. * @A: The number A. * @b: The number B. */ typedef void (*sum)(int a, int b); Which gave: :WARN: no description found for return-value of function 'sum()' Looking at kernel-doc original code, the regex is the same, but the extra space is dropped [1]: $return_type =~ s/^\s+//; [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6b80975c630 Signed-off-by: Nicolas Schodet <nico@ni.fr.eu.org>
1 parent 09205c1 commit 365757c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

linuxdoc/kernel_doc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2789,7 +2789,7 @@ def dump_typedef(self, proto):
27892789
if matchExpr:
27902790
# Parse function prototypes
27912791

2792-
self.ctx.return_type = matchExpr[0]
2792+
self.ctx.return_type = matchExpr[0].lstrip()
27932793
self.ctx.decl_name = matchExpr[1]
27942794
self.check_return_section(self.ctx.decl_name, self.ctx.return_type)
27952795

0 commit comments

Comments
 (0)