瀏覽代碼

kernel-doc: strip leading blank lines from inline doc comments

The inline member markup allows whitespace lines before the actual
documentation starts. Strip the leading blank lines. This improves the
rst output.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Jani Nikula 9 年之前
父節點
當前提交
6450c8957e
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      scripts/kernel-doc

+ 4 - 0
scripts/kernel-doc

@@ -2889,6 +2889,10 @@ sub process_file($) {
 	    } elsif (/$doc_content/) {
 		if ($inline_doc_state == STATE_INLINE_TEXT) {
 		    $contents .= $1 . "\n";
+		    # nuke leading blank lines
+		    if ($contents =~ /^\s*$/) {
+			$contents = "";
+		    }
 		} elsif ($inline_doc_state == STATE_INLINE_NAME) {
 		    $inline_doc_state = STATE_INLINE_ERROR;
 		    print STDERR "Warning(${file}:$.): ";