Skip to content

Commit b0d60bf

Browse files
author
Jonathan Corbet
committed
kernel-doc: always name missing kerneldoc sections
The "no structured comments found" warning is not particularly useful if there are several invocations, one of which is looking for something wrong. So if something specific has been requested, make it clear that it's the one we weren't able to find. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
1 parent 3f715b1 commit b0d60bf

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

‎scripts/kernel-doc‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ use constant {
285285
OUTPUT_INTERNAL => 4, # output non-exported symbols
286286
};
287287
my $output_selection = OUTPUT_ALL;
288-
my $show_not_found = 0;
288+
my $show_not_found = 0; # No longer used
289289

290290
my @export_file_list;
291291

@@ -435,7 +435,7 @@ while ($ARGV[0] =~ m/^--?(.*)/) {
435435
} elsif ($cmd eq 'enable-lineno') {
436436
$enable_lineno = 1;
437437
} elsif ($cmd eq 'show-not-found') {
438-
$show_not_found = 1;
438+
$show_not_found = 1; # A no-op but don't fail
439439
} else {
440440
# Unknown argument
441441
usage();
@@ -2163,12 +2163,14 @@ sub process_file($) {
21632163
}
21642164

21652165
# Make sure we got something interesting.
2166-
if ($initial_section_counter == $section_counter) {
2167-
if ($output_mode ne "none") {
2168-
print STDERR "${file}:1: warning: no structured comments found\n";
2166+
if ($initial_section_counter == $section_counter && $
2167+
output_mode ne "none") {
2168+
if ($output_selection == OUTPUT_INCLUDE) {
2169+
print STDERR "${file}:1: warning: '$_' not found\n"
2170+
for keys %function_table;
21692171
}
2170-
if (($output_selection == OUTPUT_INCLUDE) && ($show_not_found == 1)) {
2171-
print STDERR " Was looking for '$_'.\n" for keys %function_table;
2172+
else {
2173+
print STDERR "${file}:1: warning: no structured comments found\n";
21722174
}
21732175
}
21742176
}

0 commit comments

Comments
 (0)