mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scripts/kernel-doc: fix empty function description section
@ 2010-03-08  5:37 Randy Dunlap
  0 siblings, 0 replies; only message in thread
From: Randy Dunlap @ 2010-03-08  5:37 UTC (permalink / raw)
  To: lkml; +Cc: akpm

From: Randy Dunlap <randy.dunlap@oracle.com>

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>
---
 scripts/kernel-doc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.33-git13.orig/scripts/kernel-doc
+++ linux-2.6.33-git13/scripts/kernel-doc
@@ -2105,7 +2105,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 = "";

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-08  5:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-08  5:37 [PATCH] scripts/kernel-doc: fix empty function description section Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®