OSDN Git Service

kernel-doc: always name missing kerneldoc sections
authorJonathan Corbet <corbet@lwn.net>
Fri, 24 May 2019 20:52:01 +0000 (14:52 -0600)
committerJonathan Corbet <corbet@lwn.net>
Mon, 27 May 2019 22:23:55 +0000 (16:23 -0600)
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>
scripts/kernel-doc

index 3350e49..c0cb41e 100755 (executable)
@@ -285,7 +285,7 @@ use constant {
     OUTPUT_INTERNAL     => 4, # output non-exported symbols
 };
 my $output_selection = OUTPUT_ALL;
-my $show_not_found = 0;
+my $show_not_found = 0;        # No longer used
 
 my @export_file_list;
 
@@ -435,7 +435,7 @@ while ($ARGV[0] =~ m/^--?(.*)/) {
     } elsif ($cmd eq 'enable-lineno') {
            $enable_lineno = 1;
     } elsif ($cmd eq 'show-not-found') {
-       $show_not_found = 1;
+       $show_not_found = 1;  # A no-op but don't fail
     } else {
        # Unknown argument
         usage();
@@ -2163,12 +2163,14 @@ sub process_file($) {
     }
 
     # Make sure we got something interesting.
-    if ($initial_section_counter == $section_counter) {
-       if ($output_mode ne "none") {
-           print STDERR "${file}:1: warning: no structured comments found\n";
+    if ($initial_section_counter == $section_counter && $
+       output_mode ne "none") {
+       if ($output_selection == OUTPUT_INCLUDE) {
+           print STDERR "${file}:1: warning: '$_' not found\n"
+               for keys %function_table;
        }
-       if (($output_selection == OUTPUT_INCLUDE) && ($show_not_found == 1)) {
-           print STDERR "    Was looking for '$_'.\n" for keys %function_table;
+       else {
+           print STDERR "${file}:1: warning: no structured comments found\n";
        }
     }
 }