Skip to content

Commit afa751e

Browse files
rddunlapJonathan Corbet
authored andcommitted
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: f624ade ("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
1 parent 75ddc07 commit afa751e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

scripts/kernel-doc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2121,6 +2121,7 @@ sub process_body($$) {
21212121
}
21222122

21232123
if (/$doc_sect/i) { # case insensitive for supported section names
2124+
$in_doc_sect = 1;
21242125
$newsection = $1;
21252126
$newcontents = $2;
21262127

0 commit comments

Comments
 (0)