All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Jonathan Corbet <corbet@lwn.net>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Linux Doc Mailing List <linux-doc@vger.kernel.org>
Subject: [PATCH v4 13/18] scripts: kernel-doc: get rid of $nested parameter
Date: Mon, 18 Dec 2017 10:30:14 -0200	[thread overview]
Message-ID: <a59e922c8ec608fb8401249b35b20603d0090155.1513599193.git.mchehab@s-opensource.com> (raw)
In-Reply-To: <cover.1513599193.git.mchehab@s-opensource.com>
In-Reply-To: <cover.1513599193.git.mchehab@s-opensource.com>

The check_sections() function has a $nested parameter, meant
to identify when a nested struct is present. As we now have
a logic that handles it, get rid of such parameter.

Suggested-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 scripts/kernel-doc | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index b0eb1cd6afbe..fadb832733d9 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1003,7 +1003,6 @@ sub dump_union($$) {
 sub dump_struct($$) {
     my $x = shift;
     my $file = shift;
-    my $nested;
 
     if ($x =~ /(struct|union)\s+(\w+)\s*{(.*)}/) {
 	my $decl_type = $1;
@@ -1063,11 +1062,9 @@ sub dump_struct($$) {
 
 	# Ignore other nested elements, like enums
 	$members =~ s/({[^\{\}]*})//g;
-	$nested = $decl_type;
-	$nested =~ s/\/\*.*?\*\///gos;
 
 	create_parameterlist($members, ';', $file);
-	check_sections($file, $declaration_name, $decl_type, $sectcheck, $struct_actual, $nested);
+	check_sections($file, $declaration_name, $decl_type, $sectcheck, $struct_actual);
 
 	# Adjust declaration for better display
 	$declaration =~ s/([{;])/$1\n/g;
@@ -1372,8 +1369,8 @@ sub push_parameter($$$) {
 	$parametertypes{$param} = $type;
 }
 
-sub check_sections($$$$$$) {
-	my ($file, $decl_name, $decl_type, $sectcheck, $prmscheck, $nested) = @_;
+sub check_sections($$$$$) {
+	my ($file, $decl_name, $decl_type, $sectcheck, $prmscheck) = @_;
 	my @sects = split ' ', $sectcheck;
 	my @prms = split ' ', $prmscheck;
 	my $err;
@@ -1407,14 +1404,6 @@ sub check_sections($$$$$$) {
 					"'$sects[$sx]' " .
 					"description in '$decl_name'\n";
 				++$warnings;
-			} else {
-				if ($nested !~ m/\Q$sects[$sx]\E/) {
-				    print STDERR "${file}:$.: warning: " .
-					"Excess $decl_type member " .
-					"'$sects[$sx]' " .
-					"description in '$decl_name'\n";
-				    ++$warnings;
-				}
 			}
 		}
 	}
@@ -1525,7 +1514,7 @@ sub dump_function($$) {
     }
 
 	my $prms = join " ", @parameterlist;
-	check_sections($file, $declaration_name, "function", $sectcheck, $prms, "");
+	check_sections($file, $declaration_name, "function", $sectcheck, $prms);
 
         # This check emits a lot of warnings at the moment, because many
         # functions don't have a 'Return' doc section. So until the number
-- 
2.14.3

  parent reply	other threads:[~2017-12-18 12:30 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18 12:30 [PATCH v4 00/18] kernel-doc: add supported to document nested structs Mauro Carvalho Chehab
2017-12-18 12:30 ` [PATCH v4 01/18] docs: kernel-doc.rst: better describe kernel-doc arguments Mauro Carvalho Chehab
2017-12-18 12:30 ` [PATCH v4 02/18] docs: kernel-doc.rst: improve private members description Mauro Carvalho Chehab
2017-12-18 12:30 ` [PATCH v4 03/18] docs: kernel-doc.rst: improve function documentation section Mauro Carvalho Chehab
2017-12-18 12:30 ` [PATCH v4 04/18] docs: kernel-doc.rst: improve structs chapter Mauro Carvalho Chehab
2017-12-18 12:30 ` [PATCH v4 05/18] docs: kernel-doc.rst: improve typedef documentation Mauro Carvalho Chehab
2017-12-18 12:30 ` [PATCH v4 06/18] docs: kernel-doc.rst: add documentation about man pages Mauro Carvalho Chehab
2017-12-18 12:30 ` [PATCH v4 07/18] docs: get rid of kernel-doc-nano-HOWTO.txt Mauro Carvalho Chehab
2017-12-18 12:30 ` [PATCH v4 08/18] scripts: kernel-doc: get rid of unused output formats Mauro Carvalho Chehab
2017-12-18 12:30 ` [PATCH v4 09/18] scripts: kernel-doc: improve argument handling Mauro Carvalho Chehab
2017-12-18 12:30 ` [PATCH v4 10/18] scripts: kernel-doc: change default to ReST format Mauro Carvalho Chehab
2017-12-18 12:30 ` [PATCH v4 11/18] scripts: kernel-doc: replace tabs by spaces Mauro Carvalho Chehab
2017-12-18 12:30 ` [PATCH v4 12/18] scripts: kernel-doc: parse next structs/unions Mauro Carvalho Chehab
2017-12-18 12:30 ` Mauro Carvalho Chehab [this message]
2017-12-18 12:30 ` [PATCH v4 14/18] scripts: kernel-doc: print the declaration name on warnings Mauro Carvalho Chehab
2017-12-21  3:40   ` kbuild test robot
2017-12-18 12:30 ` [PATCH v4 15/18] scripts: kernel-doc: handle nested struct function arguments Mauro Carvalho Chehab
2017-12-21  6:48   ` kbuild test robot
2017-12-18 12:30 ` [PATCH v4 16/18] scripts: kernel-doc: improve nested logic to handle multiple identifiers Mauro Carvalho Chehab
2017-12-21  9:57   ` kbuild test robot
2018-02-14 16:07   ` Jani Nikula
2018-02-14 17:53     ` Mauro Carvalho Chehab
2018-02-14 18:20       ` Jani Nikula
2018-02-16 14:09         ` Mauro Carvalho Chehab
2017-12-18 12:30 ` [PATCH v4 17/18] scripts: kernel-doc: apply filtering rules to warnings Mauro Carvalho Chehab
2017-12-18 12:30 ` [PATCH v4 18/18] w1_netlink.h: add support for nested structs Mauro Carvalho Chehab
2017-12-21 21:08 ` [PATCH v4 00/18] kernel-doc: add supported to document " Jonathan Corbet
2017-12-21 21:35   ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a59e922c8ec608fb8401249b35b20603d0090155.1513599193.git.mchehab@s-opensource.com \
    --to=mchehab@s-opensource.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.