kernel-doc: reset contents and section harder
authorJani Nikula <jani.nikula@intel.com>
Mon, 30 May 2016 08:21:06 +0000 (11:21 +0300)
committerJani Nikula <jani.nikula@intel.com>
Mon, 30 May 2016 10:39:04 +0000 (13:39 +0300)
If the documentation comment does not have params or sections, the
section heading may leak from the previous documentation comment.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
scripts/kernel-doc

index 3ac4b57ed76a5c5b03db683a431200a694b2a173..0eb2e7b5bf101cb66b79a8fb0bc47490b2dea19e 100755 (executable)
@@ -2763,6 +2763,8 @@ sub process_file($) {
                }
 
                $state = STATE_FIELD;
+               $contents = "";
+               $section = $section_default;
                if (/-(.*)/) {
                    # strip leading/trailing/multiple spaces
                    $descr= $1;
@@ -2960,6 +2962,7 @@ sub process_file($) {
                elsif (/$doc_end/)
                {
                        dump_doc_section($file, $section, xml_escape($contents));
+                       $section = $section_default;
                        $contents = "";
                        $function = "";
                        %parameterdescs = ();