Skip to content

Commit

Permalink
kernel-doc: warn on badly formatted short description
Browse files Browse the repository at this point in the history
Make kernel-doc warn when a function/struct/union/typedef does not contain
a properly formatted short description, such as:
 * scsi_devinfo: set up the dynamic device list
or
 * scsi_devinfo -

This warning is only generated when verbose (-v) mode is used.

Also explain the -v command line option in the -h output.

Signed-off-by: Randy Dunlap <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
rddunlap authored and Linus Torvalds committed Feb 7, 2008
1 parent 792aa2f commit 77cc23b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/kernel-doc
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ sub usage {
print " [ -function funcname [ -function funcname ...] ]\n";
print " [ -nofunction funcname [ -nofunction funcname ...] ]\n";
print " c source file(s) > outputfile\n";
print " -v : verbose output, more warnings & other info listed\n";
exit 1;
}

Expand Down Expand Up @@ -1881,6 +1882,13 @@ sub process_file($) {
} else {
$declaration_purpose = "";
}

if (($declaration_purpose eq "") && $verbose) {
print STDERR "Warning(${file}:$.): missing initial short description on line:\n";
print STDERR $_;
++$warnings;
}

if ($identifier =~ m/^struct/) {
$decl_type = 'struct';
} elsif ($identifier =~ m/^union/) {
Expand Down

0 comments on commit 77cc23b

Please sign in to comment.