aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-11-12 18:11:12 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-12 22:09:32 -0500
commite946c43a116526e3d947dc03aeb165c1effd9f8f (patch)
tree9118f9c6ec4a286e3be3d3e6c38fee8752b6966d
parentc7708649ccbdc21e85c95ca1a01b28342d939d39 (diff)
kernel-doc: improve "no structured comments found" error
When using '!Ffile function' in a docbook template, and the function no longer exists, you get a "no structured comments found" error from the kernel-doc processing script. It's useful to know which functions it was looking for, so print them out in this case. Also do the same for '!Pfile doc-section' The same error also happens when using '!Efile' when some exported functions aren't documented (in the same file.) There's a very large number of such functions though, so don't print the message in this case -- right now it would give ~850 messages. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Cc: Rob Landley <rob@landley.net> Cc: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--scripts/docproc.c14
-rwxr-xr-xscripts/kernel-doc6
2 files changed, 15 insertions, 5 deletions
diff --git a/scripts/docproc.c b/scripts/docproc.c
index 4cfdc1797eb8..2b69eaf5b646 100644
--- a/scripts/docproc.c
+++ b/scripts/docproc.c
@@ -72,6 +72,7 @@ FILELINE * docsection;
72#define FUNCTION "-function" 72#define FUNCTION "-function"
73#define NOFUNCTION "-nofunction" 73#define NOFUNCTION "-nofunction"
74#define NODOCSECTIONS "-no-doc-sections" 74#define NODOCSECTIONS "-no-doc-sections"
75#define SHOWNOTFOUND "-show-not-found"
75 76
76static char *srctree, *kernsrctree; 77static char *srctree, *kernsrctree;
77 78
@@ -294,6 +295,7 @@ static void singfunc(char * filename, char * line)
294 int startofsym = 1; 295 int startofsym = 1;
295 vec[idx++] = KERNELDOC; 296 vec[idx++] = KERNELDOC;
296 vec[idx++] = DOCBOOK; 297 vec[idx++] = DOCBOOK;
298 vec[idx++] = SHOWNOTFOUND;
297 299
298 /* Split line up in individual parameters preceded by FUNCTION */ 300 /* Split line up in individual parameters preceded by FUNCTION */
299 for (i=0; line[i]; i++) { 301 for (i=0; line[i]; i++) {
@@ -325,7 +327,8 @@ static void singfunc(char * filename, char * line)
325 */ 327 */
326static void docsect(char *filename, char *line) 328static void docsect(char *filename, char *line)
327{ 329{
328 char *vec[6]; /* kerneldoc -docbook -function "section" file NULL */ 330 /* kerneldoc -docbook -show-not-found -function "section" file NULL */
331 char *vec[7];
329 char *s; 332 char *s;
330 333
331 for (s = line; *s; s++) 334 for (s = line; *s; s++)
@@ -341,10 +344,11 @@ static void docsect(char *filename, char *line)
341 344
342 vec[0] = KERNELDOC; 345 vec[0] = KERNELDOC;
343 vec[1] = DOCBOOK; 346 vec[1] = DOCBOOK;
344 vec[2] = FUNCTION; 347 vec[2] = SHOWNOTFOUND;
345 vec[3] = line; 348 vec[3] = FUNCTION;
346 vec[4] = filename; 349 vec[4] = line;
347 vec[5] = NULL; 350 vec[5] = filename;
351 vec[6] = NULL;
348 exec_kernel_doc(vec); 352 exec_kernel_doc(vec);
349} 353}
350 354
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 4305b2f2ec5e..dbd3e1ebbdad 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -257,6 +257,7 @@ my $man_date = ('January', 'February', 'March', 'April', 'May', 'June',
257 'July', 'August', 'September', 'October', 257 'July', 'August', 'September', 'October',
258 'November', 'December')[(localtime)[4]] . 258 'November', 'December')[(localtime)[4]] .
259 " " . ((localtime)[5]+1900); 259 " " . ((localtime)[5]+1900);
260my $show_not_found = 0;
260 261
261# Essentially these are globals. 262# Essentially these are globals.
262# They probably want to be tidied up, made more localised or something. 263# They probably want to be tidied up, made more localised or something.
@@ -369,6 +370,8 @@ while ($ARGV[0] =~ m/^-(.*)/) {
369 usage(); 370 usage();
370 } elsif ($cmd eq '-no-doc-sections') { 371 } elsif ($cmd eq '-no-doc-sections') {
371 $no_doc_sections = 1; 372 $no_doc_sections = 1;
373 } elsif ($cmd eq '-show-not-found') {
374 $show_not_found = 1;
372 } 375 }
373} 376}
374 377
@@ -2536,6 +2539,9 @@ sub process_file($) {
2536 } 2539 }
2537 if ($initial_section_counter == $section_counter) { 2540 if ($initial_section_counter == $section_counter) {
2538 print STDERR "Warning(${file}): no structured comments found\n"; 2541 print STDERR "Warning(${file}): no structured comments found\n";
2542 if (($function_only == 1) && ($show_not_found == 1)) {
2543 print STDERR " Was looking for '$_'.\n" for keys %function_table;
2544 }
2539 if ($output_mode eq "xml") { 2545 if ($output_mode eq "xml") {
2540 # The template wants at least one RefEntry here; make one. 2546 # The template wants at least one RefEntry here; make one.
2541 print "<refentry>\n"; 2547 print "<refentry>\n";