* [PATCH] kernel-doc: handle a void function without producing a warning
@ 2023-12-26 6:52 Randy Dunlap
2024-01-03 21:13 ` Jonathan Corbet
0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2023-12-26 6:52 UTC (permalink / raw)
To: linux-kernel; +Cc: Randy Dunlap, Jani Nikula, Jonathan Corbet, linux-doc
Currently a void function can produce a warning:
main.c:469: warning: contents before sections
This one is from arch/x86/kernel/cpu/sgx/main.c (which is not included
in any produced kernel documentation output).
Handle this by setting $in_doc_sect to 1 whenever any recognized
document section name is processed.
Fixes: f624adef3d0b ("kernel-doc: limit the "section header:" detection to a select few")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org
---
scripts/kernel-doc | 1 +
1 file changed, 1 insertion(+)
diff -- a/scripts/kernel-doc b/scripts/kernel-doc
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -2126,6 +2126,7 @@ sub process_body($$) {
}
if (/$doc_sect/i) { # case insensitive for supported section names
+ $in_doc_sect = 1;
$newsection = $1;
$newcontents = $2;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] kernel-doc: handle a void function without producing a warning
2023-12-26 6:52 [PATCH] kernel-doc: handle a void function without producing a warning Randy Dunlap
@ 2024-01-03 21:13 ` Jonathan Corbet
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Corbet @ 2024-01-03 21:13 UTC (permalink / raw)
To: Randy Dunlap, linux-kernel; +Cc: Randy Dunlap, Jani Nikula, linux-doc
Randy Dunlap <rdunlap@infradead.org> writes:
> Currently a void function can produce a warning:
> main.c:469: warning: contents before sections
>
> This one is from arch/x86/kernel/cpu/sgx/main.c (which is not included
> in any produced kernel documentation output).
>
> Handle this by setting $in_doc_sect to 1 whenever any recognized
> document section name is processed.
>
> Fixes: f624adef3d0b ("kernel-doc: limit the "section header:" detection to a select few")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: linux-doc@vger.kernel.org
> ---
> scripts/kernel-doc | 1 +
> 1 file changed, 1 insertion(+)
>
> diff -- a/scripts/kernel-doc b/scripts/kernel-doc
> --- a/scripts/kernel-doc
> +++ b/scripts/kernel-doc
> @@ -2126,6 +2126,7 @@ sub process_body($$) {
> }
>
> if (/$doc_sect/i) { # case insensitive for supported section names
> + $in_doc_sect = 1;
> $newsection = $1;
Applied, thanks.
jon
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-03 21:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-26 6:52 [PATCH] kernel-doc: handle a void function without producing a warning Randy Dunlap
2024-01-03 21:13 ` Jonathan Corbet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).