Skip to content

Commit

Permalink
scripts/kernel-doc: fix empty function description section
Browse files Browse the repository at this point in the history
scripts/kernel-doc mishandles a function that has a multi-line function
short description and no function parameters.  The observed problem was
from drivers/scsi/scsi_netlink.c:

/**
 * scsi_netlink_init - Called by SCSI subsystem to intialize
 * 	the SCSI transport netlink interface
 *
 **/

kernel-doc treated the " * " line as a Description: section with only a
newline character in the Description contents.  This caused
output_highlight() to complain: "output_highlight got called with no
args?", plus produce a perl call stack backtrace.

The fix is just to ignore Description sections if they only contain "\n".

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
rddunlap authored and torvalds committed Mar 12, 2010
1 parent b6b6e2b commit 4c98eca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/kernel-doc
Original file line number Diff line number Diff line change
Expand Up @@ -2103,7 +2103,7 @@ sub process_file($) {
$section = $newsection;
} elsif (/$doc_end/) {

if ($contents ne "") {
if (($contents ne "") && ($contents ne "\n")) {
dump_section($file, $section, xml_escape($contents));
$section = $section_default;
$contents = "";
Expand Down

0 comments on commit 4c98eca

Please sign in to comment.