Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1419465

[docs-next PATCH 2/9] kernel-doc: do not warn about duplicate default section names

From Jani Nikula <jani.nikula@intel.com>
Newsgroups linux.kernel
Subject [docs-next PATCH 2/9] kernel-doc: do not warn about duplicate default section names
Date 2016-06-10 16:20 +0200
Message-ID <rIvrY-5BP-11@gated-at.bofh.it> (permalink)
References <rIvrX-5BP-1@gated-at.bofh.it>
Organization Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo

Show all headers | View raw


Since

commit 32217761ee9db0215350dfe1ca4e66f312fb8c54
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Sun May 29 09:40:44 2016 +0300

    kernel-doc: concatenate contents of colliding sections

we started getting (more) errors on duplicate section names, especially
on the default section name "Description":

include/net/mac80211.h:3174: warning: duplicate section name 'Description'

This is usually caused by a slightly unorthodox placement of parameter
descriptions, like in the above case, and kernel-doc resetting back to
the default section more than once within a kernel-doc comment.

Ignore warnings on the duplicate section name automatically assigned by
kernel-doc, and only consider explicitly user assigned duplicate section
names an issue.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 scripts/kernel-doc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index ac18eb5ed776..710615f3a4ff 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -542,8 +542,11 @@ sub dump_section {
         $new_start_line = 0;
     } else {
 	if (defined($sections{$name}) && ($sections{$name} ne "")) {
-	    print STDERR "${file}:$.: warning: duplicate section name '$name'\n";
-	    ++$warnings;
+	    # Only warn on user specified duplicate section names.
+	    if ($name ne $section_default) {
+		print STDERR "${file}:$.: warning: duplicate section name '$name'\n";
+		++$warnings;
+	    }
 	    $sections{$name} .= $contents;
 	} else {
 	    $sections{$name} = $contents;
-- 
2.1.4

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[docs-next PATCH 0/9] Documentation/sphinx follow-up Jani Nikula <jani.nikula@intel.com> - 2016-06-10 16:20 +0200
  [docs-next PATCH 3/9] kernel-doc: add missing semi-colons in option parsing Jani Nikula <jani.nikula@intel.com> - 2016-06-10 16:20 +0200
  [docs-next PATCH 4/9] kernel-doc: abstract filename mapping Jani Nikula <jani.nikula@intel.com> - 2016-06-10 16:20 +0200
  [docs-next PATCH 2/9] kernel-doc: do not warn about duplicate default section names Jani Nikula <jani.nikula@intel.com> - 2016-06-10 16:20 +0200
  [docs-next PATCH 7/9] Documentation/sphinx: remove unnecessary temporary variable Jani Nikula <jani.nikula@intel.com> - 2016-06-10 16:20 +0200
  [docs-next PATCH 1/9] kernel-doc: remove old debug cruft from dump_section() Jani Nikula <jani.nikula@intel.com> - 2016-06-10 16:20 +0200
  [docs-next PATCH 9/9] Documentation/sphinx: add support for specifying extra export files Jani Nikula <jani.nikula@intel.com> - 2016-06-10 16:20 +0200
  [docs-next PATCH 8/9] Documentation/sphinx: use a more sensible string split in kernel-doc extension Jani Nikula <jani.nikula@intel.com> - 2016-06-10 16:20 +0200

csiph-web