Skip to contentSkip to conversation

scripts: kernel_doc: fixup reporting of function identifiers

PATCH In review Mike Rapoport 3 participants 4 messages Feb 13, 2018 – Feb 18, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts: kernel_doc: fixup reporting of function identifiers

When function description includes brackets after the function name as suggested by Documentation/doc-guide/kernel-doc, the kernel-doc script omits the function name from "Scanning doc for" report. Extending match for identifier name with optional brackets fixes this issue.

---
 scripts/kernel-doc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kernel-doc +1 -1
index fee8952037b1..a6a9a8ef116c 100755
@@ -1873,7 +1873,7 @@ sub process_file($) {
 	    }
 	    elsif (/$doc_decl/o) {
 		$identifier = $1;
-		if (/\s*([\w\s]+?)\s*-/) {
+		if (/\s*([\w\s]+?)(\(\))?\s*-/) {
 		    $identifier = $1;
 		}
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 5 lines · On Tue, 13 Feb 2018 13:31:46 +0200 Mike Rapoport <[email protected]>…

When function description includes brackets after the function name as suggested by Documentation/doc-guide/kernel-doc, the kernel-doc script omits the function name from "Scanning doc for" report. Extending match for identifier name with optional brackets fixes this issue.

So let me channel akpm here and ask: what are the user-visible effects of this problem? I ask because applying it doesn't make any difference in the "make htmldocs" output here. So I don't understand why you're wanting to make this change.

Thanks,

jon

#2 lore raw
Quoted 12 lines

Am 16.02.2018 um 15:56 schrieb Jonathan Corbet <[email protected]>:

Quoted 5 lines · On Tue, 13 Feb 2018 13:31:46 +0200 Mike Rapoport <[email protected]>…

When function description includes brackets after the function name as suggested by Documentation/doc-guide/kernel-doc, the kernel-doc script omits the function name from "Scanning doc for" report. Extending match for identifier name with optional brackets fixes this issue.

Quoted 4 lines

So let me channel akpm here and ask: what are the user-visible effects of this problem? I ask because applying it doesn't make any difference in the "make htmldocs" output here. So I don't understand why you're wanting to make this change.

Use kernel-doc -v and take a look on the info-messages.

In Documentation/doc-guide/kernel-doc we recommend to use

/**
* foo() - lorem ipsum

to tag functions, but if you do so, the info message is broken, the function name is missed at the end of the message:

../test123.c:2: info: Scanning doc for

Here is the similar patch to kernel-doc python version:

https://github.com/return42/linuxdoc/commit/84d665df34cc3c9908a4b8ce0fdf193165a1ffa4

@Mike: thanks!

--Markus--

#3 lore raw
Quoted 9 lines · On Fri, 16 Feb 2018 17:36:07 +0100 Markus Heiser <[email protected]>…
Quoted 4 lines

So let me channel akpm here and ask: what are the user-visible effects of this problem? I ask because applying it doesn't make any difference in the "make htmldocs" output here. So I don't understand why you're wanting to make this change.

Use kernel-doc -v and take a look on the info-messages.

In Documentation/doc-guide/kernel-doc we recommend to use

Quoted 7 lines

/**
* foo() - lorem ipsum

to tag functions, but if you do so, the info message is broken, the function name is missed at the end of the message:

../test123.c:2: info: Scanning doc for

OK, so I guess that message is the only effect of this bug. Oh well, I'll go ahead and apply the patch, thanks.

jon