diff options
author | Randy Dunlap <rdunlap@infradead.org> | 2023-12-25 22:52:19 -0800 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2024-01-03 14:04:31 -0700 |
commit | afa751e84c30b517aebd418970d222c39c81acb8 (patch) | |
tree | 779393627a813a2d3590906282fd35b131a119a7 /scripts/kernel-doc | |
parent | 75ddc07835ab20fcd7b79710ab766bde71873d53 (diff) | |
download | lwn-afa751e84c30b517aebd418970d222c39c81acb8.tar.gz lwn-afa751e84c30b517aebd418970d222c39c81acb8.zip |
kernel-doc: handle a void function without producing a warning
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
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20231226065219.319-1-rdunlap@infradead.org
Diffstat (limited to 'scripts/kernel-doc')
-rwxr-xr-x | scripts/kernel-doc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 3cdc7dba37e3..3ecdab5ca612 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -2121,6 +2121,7 @@ sub process_body($$) { } if (/$doc_sect/i) { # case insensitive for supported section names + $in_doc_sect = 1; $newsection = $1; $newcontents = $2; |